[mythtv] Auto shutdown occurs while transcode/commflag job is in progress (bad idle detection)
Matt Doran
matt.doran at papercut.biz
Sun Apr 22 12:53:14 UTC 2007
Chris Pinkham wrote:
> * On Mon Apr 16, 2007 at 09:57:02AM +1000, Matt Doran wrote:
>
>>> * Make CheckShutdownServer() or whatever code actually gets executed
>>> check for pending jobs in the JobQueue.
>>>
>> If I were to develop a patch for this, how does this sound:
>>
>> * Add a new test to GetStatus() to check for pending jobs (if not in
>> the job window, we treat it like no jobs are pending)
>> * Return status "32" (currently not used) to indicate there are jobs
>> pending.
>>
>
> Sounds OK to me, but I'm not the mythshutdown guy (I'm the JobQueue guy).
>
> If you make a patch, can you put the logic inside a new method inside the
> JobQueue class?
>
> I'm thinking something like this:
>
> static bool JobQueue::HasPendingJobs(bool checkWindow = true)
>
> If HasPendingJobs is static then you can just call it as
> "if (JobQueue::HasPendingJobs())" inside the status check code.
>
> If we call it as JobQueue::HasPendingJobs(false) then it can tell us if
> there are any pending jobs at all, whether we are inside the window or not.
>
Hi Chris,
I just started work on the patch (my first for mythtv). Before I go too
far I just wanted to check if you approve of the first step. The patch
is attached, and so far I've done the following:
* Refactored the code that checks if we're in the job window into a
new method - bool InJobRunWindow()
* Use this in the job processing loop
* This will also be used in the new HasPendingJobs() method.
* Added shells of two new methods that I intend to call from
mythshutdown.
Any feedback, comments appreciated. If you think I'm on the right
track, I'll finish off the patch in the next few days.
Thanks,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20070422/0c428f16/attachment.htm
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jobqueue.diff
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20070422/0c428f16/attachment.diff
More information about the mythtv-dev
mailing list