Fix terrasync behaviour when net is down.

This commit is contained in:
James Turner 2016-08-19 18:13:31 +01:00
parent 6e5cbd7fc5
commit 87590cafb2
2 changed files with 8 additions and 2 deletions

View File

@ -1239,7 +1239,7 @@ HTTPRepository::failure() const
void HTTPRepoPrivate::failedToGetRootIndex(HTTPRepository::ResultCode st)
{
SG_LOG(SG_TERRASYNC, SG_WARN, "Failed to get root of repo:" << baseUrl);
SG_LOG(SG_TERRASYNC, SG_WARN, "Failed to get root of repo:" << baseUrl << " " << st);
status = st;
}
@ -1288,7 +1288,6 @@ HTTPRepository::failure() const
// maybe there was nothing to do
if (activeRequests.empty()) {
status = HTTPRepository::REPO_NO_ERROR;
isUpdating = false;
}
}

View File

@ -496,6 +496,13 @@ void SGTerraSync::WorkerThread::run()
}
}
if (_httpServer.empty()) {
SG_LOG(SG_TERRASYNC, SG_ALERT, "ERROR: no http-server found, terrasync will be disabled");
SGGuard<SGMutex> g(_stateLock);
_running = false;
return;
}
runInternal();
{