added optional delay to check files after download in order to prevent skiping recently downloaded files

This commit is contained in:
csoler 2020-01-29 22:04:29 +01:00
parent 0efc6b00a1
commit 10bee9f26b
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
9 changed files with 18 additions and 14 deletions

View file

@ -107,10 +107,13 @@ void LocalDirectoryUpdater::threadTick()
}
}
void LocalDirectoryUpdater::forceUpdate()
void LocalDirectoryUpdater::forceUpdate(bool add_safe_delay)
{
mForceUpdate = true ;
mLastSweepTime = 0 ;
mLastSweepTime = rstime_t(time(NULL)) - rstime_t(mDelayBetweenDirectoryUpdates) ;
if(add_safe_delay)
mLastSweepTime += rstime_t(MIN_TIME_AFTER_LAST_MODIFICATION);
if(mHashCache != NULL && mHashCache->hashingProcessPaused())
mHashCache->togglePauseHashingProcess();
@ -363,7 +366,7 @@ void LocalDirectoryUpdater::setFollowSymLinks(bool b)
mFollowSymLinks = b ;
forceUpdate();
forceUpdate(false);
}
bool LocalDirectoryUpdater::followSymLinks() const