Committing updates.
This commit is contained in:
@@ -291,12 +291,23 @@ namespace Apostol {
|
||||
Context.Tokens().Values("access_token", Json["access_token"].AsString());
|
||||
|
||||
Context.SetFixedDate(0);
|
||||
Context.SetCheckDate(Now() + (CDateTime) 55 / MinsPerDay); // 55 min
|
||||
Context.SetCheckDate(Now() + (CDateTime) 50 / MinsPerDay); // 50 min
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
auto OnFail = [&Context](CTCPConnection *Sender, const Delphi::Exception::Exception &E) {
|
||||
Context.SetStatus(csInitialized);
|
||||
|
||||
auto pConnection = dynamic_cast<CHTTPClientConnection *> (Sender);
|
||||
auto pClient = dynamic_cast<CHTTPClient *> (pConnection->Client());
|
||||
|
||||
DebugReply(pConnection->Reply());
|
||||
|
||||
Log()->Error(APP_LOG_ERR, 0, "[%s:%d] %s", pClient->Host().c_str(), pClient->Port(), E.what());
|
||||
};
|
||||
|
||||
auto OnHTTPClient = [this](const CLocation &URI) {
|
||||
return GetClient(URI.hostname, URI.port);
|
||||
};
|
||||
@@ -309,7 +320,7 @@ namespace Apostol {
|
||||
Context.Tokens().Values("service_token", service_token);
|
||||
|
||||
if (!token_uri.IsEmpty()) {
|
||||
CToken::FetchAccessToken(token_uri.front() == '/' ? server_uri + token_uri : token_uri, service_token, OnHTTPClient, OnDone);
|
||||
CToken::FetchAccessToken(token_uri.front() == '/' ? server_uri + token_uri : token_uri, service_token, OnHTTPClient, OnDone, OnFail);
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
@@ -342,14 +353,6 @@ namespace Apostol {
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
int CWebService::NextServerIndex() {
|
||||
m_ServerIndex++;
|
||||
if (m_ServerIndex >= m_Servers.Count())
|
||||
m_ServerIndex = -1;
|
||||
return m_ServerIndex;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
bool CWebService::DoProxyExecute(CTCPConnection *AConnection) {
|
||||
|
||||
auto pConnection = dynamic_cast<CHTTPClientConnection *> (AConnection);
|
||||
@@ -420,8 +423,7 @@ namespace Apostol {
|
||||
}
|
||||
}
|
||||
|
||||
Log()->Error(APP_LOG_EMERG, 0, "[%s:%d] %s", pProxy->Host().c_str(), pProxy->Port(),
|
||||
E.what());
|
||||
Log()->Error(APP_LOG_EMERG, 0, "[%s:%d] %s", pProxy->Host().c_str(), pProxy->Port(), E.what());
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1671,7 +1673,7 @@ namespace Apostol {
|
||||
|
||||
if (Now >= Context.CheckDate()) {
|
||||
Context.SetCheckDate(Now + (CDateTime) 30 / SecsPerDay); // 30 sec
|
||||
if ((Context.Status() == Context::csInitialized) || (Context.Status() == Context::csRunning)) {
|
||||
if (Context.Status() != Context::csAuthorization) {
|
||||
Context.SetStatus(Context::csAuthorization);
|
||||
|
||||
CheckProviders(Now, Context);
|
||||
|
||||
Reference in New Issue
Block a user