Skip to content

Commit

Permalink
Unfuck announcing.
Browse files Browse the repository at this point in the history
Andersbakken committed Feb 21, 2014
1 parent e25f226 commit 6bfa7b3
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/Server.cpp
Original file line number Diff line number Diff line change
@@ -2081,24 +2081,20 @@ void Server::work()
if (mOptions.options & NoJobServer)
return;

if (!mAnnounced) {
if (!mAnnounced && announcables) {
mAnnounced = true;
if (announcables) {
if (debugMulti)
error() << "announcing because we have" << announcables << "announcables";
if (mServerConnection) {
mServerConnection->send(ProxyJobAnnouncementMessage(mOptions.tcpPort));
} else {
const JobAnnouncementMessage msg(mHostName, mOptions.tcpPort);
for (auto client : mClients) {
client->send(msg);
}
if (debugMulti)
error() << "announcing because we have" << announcables << "announcables";
if (mServerConnection) {
mServerConnection->send(ProxyJobAnnouncementMessage(mOptions.tcpPort));
} else {
const JobAnnouncementMessage msg(mHostName, mOptions.tcpPort);
for (auto client : mClients) {
client->send(msg);
}
} else if (debugMulti) {
error() << "Nothing to announce";
}
} else if (debugMulti) {
error() << "Already announced";
error() << (mAnnounced ? "Already announced" : "Nothing to announce");
}

if (jobs <= 0)

0 comments on commit 6bfa7b3

Please sign in to comment.