mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
added auto-remove of unused and dummy locations every 10 minutes (still keeping at least one location for each GPG key). Suppressed exchange of p3disc info for dummy locations.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3915 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1495758d45
commit
98f471c56b
6 changed files with 239 additions and 148 deletions
|
@ -570,6 +570,18 @@ void p3ConnectMgr::tick()
|
|||
statusTick();
|
||||
tickMonitors();
|
||||
|
||||
static time_t last_friends_check = time(NULL) ;
|
||||
static const time_t INTERVAL_BETWEEN_LOCATION_CLEANING = 600 ; // Remove unused locations every 10 minutes.
|
||||
|
||||
time_t now = time(NULL) ;
|
||||
|
||||
if(now > last_friends_check + INTERVAL_BETWEEN_LOCATION_CLEANING && rsPeers != NULL)
|
||||
{
|
||||
std::cerr << "p3ConnectMgr::tick(): cleaning unused locations." << std::endl ;
|
||||
|
||||
rsPeers->cleanUnusedLocations() ;
|
||||
last_friends_check = now ;
|
||||
}
|
||||
}
|
||||
|
||||
bool p3ConnectMgr::shutdown() /* blocking shutdown call */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue