fix placement of _logDirectory member variable

This commit is contained in:
Stephen Birarda 2016-01-05 11:57:39 -08:00
parent 4f6595ed08
commit e6ccce6a38

View file

@ -34,6 +34,7 @@ AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmen
Assignment::Type requestAssignmentType, QString assignmentPool, Assignment::Type requestAssignmentType, QString assignmentPool,
quint16 listenPort, QUuid walletUUID, QString assignmentServerHostname, quint16 listenPort, QUuid walletUUID, QString assignmentServerHostname,
quint16 assignmentServerPort, quint16 httpStatusServerPort, QDir logDirectory) : quint16 assignmentServerPort, quint16 httpStatusServerPort, QDir logDirectory) :
_logDirectory(logDirectory),
_httpManager(QHostAddress::LocalHost, httpStatusServerPort, "", this), _httpManager(QHostAddress::LocalHost, httpStatusServerPort, "", this),
_numAssignmentClientForks(numAssignmentClientForks), _numAssignmentClientForks(numAssignmentClientForks),
_minAssignmentClientForks(minAssignmentClientForks), _minAssignmentClientForks(minAssignmentClientForks),
@ -42,8 +43,8 @@ AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmen
_assignmentPool(assignmentPool), _assignmentPool(assignmentPool),
_walletUUID(walletUUID), _walletUUID(walletUUID),
_assignmentServerHostname(assignmentServerHostname), _assignmentServerHostname(assignmentServerHostname),
_assignmentServerPort(assignmentServerPort), _assignmentServerPort(assignmentServerPort)
_logDirectory(logDirectory)
{ {
qDebug() << "_requestAssignmentType =" << _requestAssignmentType; qDebug() << "_requestAssignmentType =" << _requestAssignmentType;
@ -200,7 +201,7 @@ void AssignmentClientMonitor::spawnChildClient() {
stderrPath = stderrPathTemp; stderrPath = stderrPathTemp;
stderrFilename = stderrFilenameTemp; stderrFilename = stderrFilenameTemp;
} }
qDebug() << "Child stdout being written to: " << stdoutFilename; qDebug() << "Child stdout being written to: " << stdoutFilename;
qDebug() << "Child stderr being written to: " << stderrFilename; qDebug() << "Child stderr being written to: " << stderrFilename;
@ -209,10 +210,10 @@ void AssignmentClientMonitor::spawnChildClient() {
// make sure we hear that this process has finished when it does // make sure we hear that this process has finished when it does
connect(assignmentClient, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), connect(assignmentClient, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, [this, pid]() { childProcessFinished(pid); }); this, [this, pid]() { childProcessFinished(pid); });
qDebug() << "Spawned a child client with PID" << assignmentClient->processId(); qDebug() << "Spawned a child client with PID" << assignmentClient->processId();
_childProcesses.insert(assignmentClient->processId(), { assignmentClient, stdoutPath, stderrPath }); _childProcesses.insert(assignmentClient->processId(), { assignmentClient, stdoutPath, stderrPath });
} }
} }
void AssignmentClientMonitor::checkSpares() { void AssignmentClientMonitor::checkSpares() {
@ -268,12 +269,12 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes
// The parent only expects to be talking with prorams running on this same machine. // The parent only expects to be talking with prorams running on this same machine.
if (senderSockAddr.getAddress() == QHostAddress::LocalHost || if (senderSockAddr.getAddress() == QHostAddress::LocalHost ||
senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) { senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) {
if (!senderID.isNull()) { if (!senderID.isNull()) {
// We don't have this node yet - we should add it // We don't have this node yet - we should add it
matchingNode = DependencyManager::get<LimitedNodeList>()->addOrUpdateNode matchingNode = DependencyManager::get<LimitedNodeList>()->addOrUpdateNode
(senderID, NodeType::Unassigned, senderSockAddr, senderSockAddr, false, false); (senderID, NodeType::Unassigned, senderSockAddr, senderSockAddr, false, false);
auto childData = std::unique_ptr<AssignmentClientChildData> auto childData = std::unique_ptr<AssignmentClientChildData>
{ new AssignmentClientChildData(Assignment::Type::AllTypes) }; { new AssignmentClientChildData(Assignment::Type::AllTypes) };
matchingNode->setLinkedData(std::move(childData)); matchingNode->setLinkedData(std::move(childData));
@ -298,9 +299,9 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes
// get child's assignment type out of the packet // get child's assignment type out of the packet
quint8 assignmentType; quint8 assignmentType;
message->readPrimitive(&assignmentType); message->readPrimitive(&assignmentType);
childData->setChildType(Assignment::Type(assignmentType)); childData->setChildType(Assignment::Type(assignmentType));
// note when this child talked // note when this child talked
matchingNode->setLastHeardMicrostamp(usecTimestampNow()); matchingNode->setLastHeardMicrostamp(usecTimestampNow());
} }