void PrePostProcessor::Run() { debug("Entering PrePostProcessor-loop"); while (!DownloadQueue::IsLoaded()) { usleep(20 * 1000); } if (g_Options->GetServerMode()) { SanitisePostQueue(); } while (!IsStopped()) { if (!g_Options->GetTempPausePostprocess() && m_queuedJobs) { // check post-queue every 200 msec CheckPostQueue(); } usleep(200 * 1000); } WaitJobs(); debug("Exiting PrePostProcessor-loop"); }
void PrePostProcessor::Run() { debug("Entering PrePostProcessor-loop"); while (!DownloadQueue::IsLoaded()) { usleep(20 * 1000); } if (g_Options->GetServerMode() && g_Options->GetSaveQueue() && g_Options->GetReloadQueue()) { SanitisePostQueue(); } while (!IsStopped()) { if (!g_Options->GetTempPausePostprocess()) { // check post-queue every 200 msec CheckPostQueue(); } Util::SetStandByMode(!m_curJob); usleep(200 * 1000); } debug("Exiting PrePostProcessor-loop"); }
void PrePostProcessor::Run() { debug("Entering PrePostProcessor-loop"); if (g_pOptions->GetServerMode() && g_pOptions->GetSaveQueue() && g_pOptions->GetReloadQueue() && g_pOptions->GetReloadPostQueue()) { DownloadQueue* pDownloadQueue = g_pQueueCoordinator->LockQueue(); SanitisePostQueue(pDownloadQueue->GetPostQueue()); g_pQueueCoordinator->UnlockQueue(); } g_pScheduler->FirstCheck(); ApplySchedulerState(); int iDiskSpaceInterval = 1000; int iSchedulerInterval = 1000; int iHistoryInterval = 60000; const int iStepMSec = 200; while (!IsStopped()) { // check incoming nzb directory g_pScanner->Check(); if (!(g_pOptions->GetPauseDownload() || g_pOptions->GetPauseDownload2()) && g_pOptions->GetDiskSpace() > 0 && !g_pQueueCoordinator->GetStandBy() && iDiskSpaceInterval >= 1000) { // check free disk space every 1 second CheckDiskSpace(); iDiskSpaceInterval = 0; } iDiskSpaceInterval += iStepMSec; // check post-queue every 200 msec CheckPostQueue(); if (iSchedulerInterval >= 1000) { // check scheduler tasks every 1 second g_pScheduler->IntervalCheck(); ApplySchedulerState(); iSchedulerInterval = 0; CheckScheduledResume(); } iSchedulerInterval += iStepMSec; if (iHistoryInterval >= 60000) { // check history (remove old entries) every 1 minute CheckHistory(); iHistoryInterval = 0; } iHistoryInterval += iStepMSec; usleep(iStepMSec * 1000); } Cleanup(); debug("Exiting PrePostProcessor-loop"); }