"Range of day" interval.

43 views
Skip to first unread message

Alonso Gómez

unread,
Mar 9, 2020, 10:46:36 AM3/9/20
to schedulix
Hi,

Is there any possibility that the "Range of day" interval has the selector every minute?

I need to run a job every minute over all the day, but between 22:30 and 22:40 this job should not be executed.

I configured this with 2 "Range of day", the first start at 00:00 an second end with 00:00... But the schedule do not run properly. If the second range end with 23:55 the schedule run properly but there are 5 minutes with the job is not executing.

Thanks in advince

Ronald Jeninga

unread,
Mar 9, 2020, 2:40:00 PM3/9/20
to schedulix
Hi Alonso,

in order to run a job every minute you choose the "repeat" set to 1 minute.
In the next line you can then filter out the unwanted period between 22:30 and 22:40.

The problem with the "range of day" here is that you can't specify a negated period (not 22:30 - 22:40), and if you specify something like "22:40 - 22:30" it will select everything because there aren't times in that range _on a single day_.
(It will select all times t with 00:00 <= t <= 22:40 or 22:30 <= t <= 24:00).
You'll have to build that yourself for now. And this can be done with the Interval editor.

In the Interval editor you create an Interval of type "List" and select 'T2230 - T2240' with an INVERSE selection. (Note the missing colons in the time specification here).
Let me assume you call this interval RANGE2230_2240.

Now you can add the second line to the job schedule. You use the Calendar Filter here and select your RANGE2230_2240. Don't forget to change the "With Select On" field to "Day".
(It would work with "Month", but you'll be rewarded with a performance penalty. The engine processes it as if you had entered a selection and would have to collect all the minutes of the month before it would be able to apply the filter. That's roundabout 30 times slower than collecting the minutes of a single day)

Oh and set the Calendar to "INACTIVE". You don't need to know in advance when it will run because it will run every minute.
No need to store those start times in the database, it's a loss of computing power and disk space for nothing.

I've added some screen shots. I hope that helps you to understand the written text.
For the sake of the example, I selected different times and set the Calendar to ACTIVE. This way you can see it works as required (the times between 11:40 and 11:50 are missing).

Best regards,

Ronald

ts_range2230_2240.png
schedule_range2230_2240.png

Alonso Gómez

unread,
Mar 10, 2020, 5:49:45 AM3/10/20
to schedulix
Hi Ronald,

I forgot to comment that I am working with Schedulix 2.8, Is the Interval Editor included in this version? If yes, where is it?

Thanks for your response.
 
Best regards,  Alonso

Dieter Stubler

unread,
Mar 10, 2020, 6:18:45 AM3/10/20
to schedulix
Hi Alonso,

The Interval Editor is a new feature of schedulix 2.9.

I highly recommend to update your installation to schedulix 2.9.

I already enhanced to GUI (2.9) so it is possible to have a Range of Day end at 23:59.
This change will be availabe in GitHub soon.

If you want to solve your problem using 2.8 you can do the following:

Open the Zope management web interface and edit the python script at SDMS/SDMSDesigner/Schedules/RenderIntervalSetup and change:

        ...
        i = 0
        while i < 60:
            istr = ('00' + str(i))[-2:]
            if me == istr:
                selected = ' selected'
            else:
                selected = ''
            html = html + '<option value="' + istr +'" style="font-family:Arial,Helvetica;"' + selected + '>' + istr +'</option>\n'
            i = i + 5
        html = html + '</SELECT>'
    elif type == 'DOW':
    ...

to:
        ...
        for i in [ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 59]:
            istr = ('00' + str(i))[-2:]
            if me == istr:
                selected = ' selected'
            else:
                selected = ''
            html = html + '<option value="' + istr +'" style="font-family:Arial,Helvetica;"' + selected + '>' + istr +'</option>\n'
        html = html + '</SELECT>'
    elif type == 'DOW':
    ...

Now you can define 2 Range of days: 00:00 - 22:30 and 22:40 to 23:59.
This should do the job for you now.

Please let us know whether you could solve your problem with this solution.

Regards
Dieter

Alonso Gómez

unread,
Mar 10, 2020, 12:40:46 PM3/10/20
to schedulix
Hi Dieter,
 
Although your solution is good, I've changed 
 
i = i + 5
to
i = i + 1
 
in the sections of code where the type is 'TOD' or 'ROD' and inside of "while i < 60: " loops
 
This way I can achieve 1 minute accuracy in "Time of Day" and "Range of Day".
 
Tell me, please, if, as far as you know, this change could cause other collateral issues.
 

Best Regards,
 
Alonso

Dieter Stubler

unread,
Mar 23, 2020, 4:39:49 AM3/23/20
to schedulix
No, this will not cause collateral issues but your change will be overwritten with the next relase.
This mayl cause probleme if you do not 'redo' your change after upgrading.
Reply all
Reply to author
Forward
0 new messages