added pausing/resuming for post-processor queue; added new modifier <O> to remote commands <--pause/-P> and <--unpause/-U>; added new commands <postpause> and <postresume> to XML-/JSON-RPC; extended output of remote command <--list/-L> to indicate paused state of post-processor queue; extended command <status> of XML-/JSON-RPC with field <PostPause>

This commit is contained in:
Andrey Prygunkov
2009-05-06 19:28:54 +00:00
parent 900968a91c
commit b1f6735e87
13 changed files with 148 additions and 69 deletions

View File

@@ -84,6 +84,7 @@ PrePostProcessor::PrePostProcessor()
m_bHasMoreJobs = false;
m_bPostPause = false;
m_bRequestedNZBDirScan = false;
m_bPause = false;
m_QueueCoordinatorObserver.owner = this;
g_pQueueCoordinator->Attach(&m_QueueCoordinatorObserver);
@@ -591,13 +592,13 @@ void PrePostProcessor::CheckPostQueue()
}
}
if (pPostInfo->GetParCheck() && pPostInfo->GetParStatus() == PARSTATUS_NOT_CHECKED)
if (pPostInfo->GetParCheck() && pPostInfo->GetParStatus() == PARSTATUS_NOT_CHECKED && !m_bPause)
{
StartParJob(pPostInfo);
}
else
#endif
if (pPostInfo->GetStage() == PostInfo::ptQueued)
if (pPostInfo->GetStage() == PostInfo::ptQueued && !m_bPause)
{
StartScriptJob(pDownloadQueue, pPostInfo);
}
@@ -637,7 +638,7 @@ void PrePostProcessor::CheckPostQueue()
JobCompleted(pDownloadQueue, pPostInfo);
}
else
else if (!m_bPause)
{
error("Internal error: invalid state in post-processor");
}