mirror of
https://github.com/nzbget/nzbget.git
synced 2025-12-23 22:27:45 -05:00
fixed #573: statistics for session download time and speed
may be way off on high load
This commit is contained in:
@@ -177,7 +177,7 @@ void QueueCoordinator::Run()
|
||||
AdjustDownloadsLimit();
|
||||
bool wasStandBy = true;
|
||||
bool articeDownloadsRunning = false;
|
||||
int resetCounter = 0;
|
||||
time_t lastReset = 0;
|
||||
g_StatMeter->IntervalCheck();
|
||||
|
||||
while (!IsStopped())
|
||||
@@ -245,8 +245,8 @@ void QueueCoordinator::Run()
|
||||
|
||||
Util::SetStandByMode(standBy);
|
||||
|
||||
resetCounter += sleepInterval;
|
||||
if (resetCounter >= 1000)
|
||||
time_t currentTime = Util::CurrentTime();
|
||||
if (lastReset != currentTime)
|
||||
{
|
||||
// this code should not be called too often, once per second is OK
|
||||
g_ServerPool->CloseUnusedConnections();
|
||||
@@ -255,10 +255,10 @@ void QueueCoordinator::Run()
|
||||
{
|
||||
SaveAllPartialState();
|
||||
}
|
||||
resetCounter = 0;
|
||||
g_StatMeter->IntervalCheck();
|
||||
g_Log->IntervalCheck();
|
||||
AdjustDownloadsLimit();
|
||||
lastReset = currentTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user