Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Questions on housekeeper thread

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


willu.mailingLists at cse

Feb 5, 2007, 4:27 PM

Post #1 of 3 (496 views)
Permalink
Questions on housekeeper thread

Hi,

Two questions on how the housekeeper thread that runs
mythfilldatabase should behave (i.e. "how do we want it to behave",
not "how does it currently behave"). At present two times are
supplied and MFD is supposed to be called 'between' those two times.
(I have an orthogonal patch in #2194, but it looks like it is going
to reveal these old issues.)

i) In current behaviour the times are inclusive by hour. So if
you specify 2pm and 4pm as the times between which you want MFD
called, then you could get it being called at 4:30pm. If that is
changed so that the end-hour is exclusive, then you wouldn't get MFD
being called at 4:30pm. The down-side on that change is that some
people want to be able to specify a particular hour in which to call
MFD. e.g. If you specify 3pm and 3pm, does that mean that MFD can
run at 3:30pm or that MFD should not be run at all?

General consensus from the list last time this was discussed was
that we should leave things as they are.

ii) At the moment the code is written to call MFD after the start
time, and before the end time. If the end time is before the start
time then MFD will not be run. This makes it impossible to say that
you want to run MFD in the middle of the night, between 11pm and
1am. If you put in a start time of 11pm and an end time of 1am,
there are no times on an individual day that are after 11pm and
before 1am, and MFD will not be run. This would seem like a good bug
to fix.

Any objections?

Will :-}

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

Feb 5, 2007, 6:17 PM

Post #2 of 3 (475 views)
Permalink
Re: Questions on housekeeper thread [In reply to]

* On Tue Feb 06, 2007 at 11:27:20AM +1100, William Uther wrote:
> i) In current behaviour the times are inclusive by hour. So if
> you specify 2pm and 4pm as the times between which you want MFD
> called, then you could get it being called at 4:30pm. If that is
> changed so that the end-hour is exclusive, then you wouldn't get MFD
> being called at 4:30pm. The down-side on that change is that some
> people want to be able to specify a particular hour in which to call
> MFD. e.g. If you specify 3pm and 3pm, does that mean that MFD can
> run at 3:30pm or that MFD should not be run at all?

It would be less confusing to leave things as they are, but if that is
done, then the descriptions in the help text need to change:

"For example, setting Start to 11 and End to 13 would mean that the
process would only run between 11 AM and 1 PM."

That is different than the actual way things work. The fix could be
as simple as changing the text to something like this:

"For example, setting Start to 11 and End to 13 would mean that the
process would only run between 11:00 AM and 1:59 PM."

> ii) At the moment the code is written to call MFD after the start
> time, and before the end time. If the end time is before the start
> time then MFD will not be run. This makes it impossible to say that
> you want to run MFD in the middle of the night, between 11pm and
> 1am. If you put in a start time of 11pm and an end time of 1am,
> there are no times on an individual day that are after 11pm and
> before 1am, and MFD will not be run. This would seem like a good bug
> to fix.

I was thinking about this the other day, but considered it another bug
so I wasn't going to say it needed to be fixed as part of your current
patch. If you want to roll it in together, that is OK with me. Just
attach a new patch to the existing ticket. I think the ability to
span midnight is useful and there is no good reason I see that we
shouldn't allow it. It will need a bit of logic in your existing patch
to be modified though. The big difference is probably that if we want
to run mfdb between 11pm and 3am, we don't mind if mfdb runs twice in
the same day at 1:30am and again at 11:45pm which would be blocked by
the current code/patch. If you want to make this a separate patch
than the existing one, I'm fine with that. I was thinking of committing
your other patch tonight anyway since it has been working fine on my
system so far.

--
Chris
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


willu.mailingLists at cse

Feb 6, 2007, 2:56 PM

Post #3 of 3 (474 views)
Permalink
Re: Questions on housekeeper thread [In reply to]

On Mon, 5 Feb 2007 21:17:58 -0500, Chris Pinkham wrote:

> That is different than the actual way things work. The fix could be
> as simple as changing the text to something like this:
>
> "For example, setting Start to 11 and End to 13 would mean that the
> process would only run between 11:00 AM and 1:59 PM."

Good fix. :) I'll update the patch tonight (Aus time). If you don't
get to it first.

>> ii) At the moment the code is written to call MFD after the start
>> time, and before the end time. If the end time is before the start
>> time then MFD will not be run. This makes it impossible to say that
>> you want to run MFD in the middle of the night, between 11pm and
>> 1am. If you put in a start time of 11pm and an end time of 1am,
>> there are no times on an individual day that are after 11pm and
>> before 1am, and MFD will not be run. This would seem like a good bug
>> to fix.
>
> I was thinking about this the other day, but considered it another bug
> so I wasn't going to say it needed to be fixed as part of your current
> patch.

Yup.

> If you want to roll it in together, that is OK with me. Just
> attach a new patch to the existing ticket. I think the ability to
> span midnight is useful and there is no good reason I see that we
> shouldn't allow it. It will need a bit of logic in your existing
> patch
> to be modified though.

Yup.

> The big difference is probably that if we want
> to run mfdb between 11pm and 3am, we don't mind if mfdb runs twice in
> the same day at 1:30am and again at 11:45pm which would be blocked by
> the current code/patch.

Yup. And we do mind if it runs on two separate days, but in the same
"period".

e.g. If you have a start time of 2pm and an end time of 10am, you
don't want two runs at 5pm and 7am only 14 hours apart.

Here is one thought:

QDate today = now.date();
QDate yesterday = today.addDays(-1);
QTime startTime = QTime(minhour, 0);
QTime endTime = QTime(maxhour, 30);

// Make laststart be the last time an 'ok to run' period started.
QDateTime startToday(today, startTime);
QDateTime startYesterday(yesterday, startTime);
QDateTime lastStart = (now >= startToday) ? startToday :
startYesterday;

// Make lastend be the last time an 'ok to run' period ended.
QDateTime endToday(today, endTime);
QDateTime endYesterday(yesterday, endTime);
QDateTime lastEnd = (now >= endToday) ? endToday : endYesterday;

boolean OkToRun =
(lastEnd < lastStart) && // in an 'ok to run' period
(lastrun < lastStart); // Haven't yet run this period

This changes the inclusive end times to be exact times that are
offset by 30 mins. With this setup there is always at least a 30
minute period each day where it is ok to run.

> If you want to make this a separate patch
> than the existing one, I'm fine with that. I was thinking of
> committing
> your other patch tonight anyway since it has been working fine on my
> system so far.

A separate patch seems like a good idea. :) This is a change that
will require a whole lot more testing.

Will :-}

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.