sigaction(SIGHUP, &sa, NULL);
#endif /* _WIN32 */
- /* update object authority */
- ApiListener::UpdateObjectAuthorityAsync();
+ ApiListener::UpdateObjectAuthority();
return Application::GetInstance()->Run();
}
ReplayLog(aclient);
+ if (endpoint->GetZone() == Zone::GetLocalZone())
+ UpdateObjectAuthority();
+
Log(LogInformation, "ApiListener")
<< "Finished sending replay log for endpoint '" << endpoint->GetName() << "'.";
} catch (const std::exception& ex) {
static Value HelloAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params);
- static void UpdateObjectAuthorityAsync(void);
+ static void UpdateObjectAuthority(void);
protected:
virtual void OnConfigLoaded(void) override;
return a->GetName() < b->GetName();
}
-static void AuthorityTimerHandler(void)
+void ApiListener::UpdateObjectAuthority(void)
{
Zone::Ptr my_zone = Zone::GetLocalZone();
}
}
-void ApiListener::UpdateObjectAuthorityAsync(void)
-{
- l_AuthorityTimer->Reschedule(0);
-}
-
static void StaticInitialize(void)
{
l_AuthorityTimer = new Timer();
- l_AuthorityTimer->OnTimerExpired.connect(boost::bind(&AuthorityTimerHandler));
- l_AuthorityTimer->SetInterval(15);
+ l_AuthorityTimer->OnTimerExpired.connect(boost::bind(&ApiListener::UpdateObjectAuthority));
+ l_AuthorityTimer->SetInterval(30);
l_AuthorityTimer->Start();
}
#include "remote/configobjectutility.hpp"
#include "remote/configpackageutility.hpp"
+#include "remote/apilistener.hpp"
#include "config/configcompiler.hpp"
#include "config/configitem.hpp"
#include "base/configwriter.hpp"
return false;
}
+
+ ApiListener::UpdateObjectAuthority();
} catch (const std::exception& ex) {
delete expr;