Make persistent storage synchronization interval configurable

This commit is contained in:
hakunamtu 2019-01-16 22:30:25 +03:00
parent fdcea5537c
commit 3fd69311cb
4 changed files with 61 additions and 21 deletions

View file

@ -109,6 +109,7 @@ namespace data
void Load ();
bool LoadRouterInfo (const std::string & path);
void SaveUpdated ();
void RemoveExpired ();
void Run (); // exploratory thread
void Explore (int numDestinations);
void Publish ();
@ -129,6 +130,8 @@ namespace data
std::map<IdentHash, std::shared_ptr<LeaseSet> > m_LeaseSets;
mutable std::mutex m_RouterInfosMutex;
std::map<IdentHash, std::shared_ptr<RouterInfo> > m_RouterInfos;
mutable std::mutex m_UnsavedProfilesMutex;
std::map<IdentHash, std::shared_ptr<RouterProfile>> m_UnsavedProfiles;
mutable std::mutex m_FloodfillsMutex;
std::list<std::shared_ptr<RouterInfo> > m_Floodfills;
@ -145,6 +148,7 @@ namespace data
friend class NetDbRequests;
NetDbRequests m_Requests;
unsigned m_PersistSyncInterval;
bool m_PersistProfiles;
/** router info we are bootstrapping from or nullptr if we are not currently doing that*/