Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003680 [Resin] minor always 09-09-09 18:00 09-10-09 09:57
Reporter emil View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.9 Product Version 3.1.9
  Product Build
Summary 0003680: scheduled tasks not working for sundays
Description (rep by jurius)

My inquiry is about the <resin:ScheduledTask> configuration problem.

We have a requirement in our application to schedule some task to run every week Sunday mornings from 1:10 AM to 1:40 AM.

The solution looks simple enough - to configure 2 scheduled tasks (to stop the process and respectively to restart it) in resin-web.xml, Resin deployment descriptor file.

Resin documentation has a very nice outline of how to configure the schduled task. In this particular case the CRON-style pattern description fits well.

Here is cron trigger syntax from online documentation http://www.caucho.com/resin/admin/scheduling.xtp [^] :

cron fields

# +---------------- minute (0 - 59)
# | +------------- hour (0 - 23)
# | | +---------- day of month (1 - 31)
# | | | +------- month (1 - 12)
# | | | | +---- day of week (0 - 6) (Sunday=0 or 7)
# | | | | |
* * * * *

Hence how the schduled tasks are written in the resin-web.xml file:

=========
<scheduled-task class="taskScheduler.StopValidation>
<cron>10 1 * 1-12 0</cron>
</scheduled-task>

<scheduled-task class="taskScheduler.RestartValidation">
<cron>40 1 * 1-12 0</cron>
</scheduled-task>
=========

10 1 * 1-12 0 means: "run every Sunday of any month at 1:10 AM". It is equivalent (according to the above pattern) to 10 1 * * 0, but I found from experience that 10 1 * 1-12 0 works much better.

The problem is that this configuration doesn't work for 0 or 7 (both for Sunday, as per the above pattern), but perfectly works for 1 to 6 (Monday - Saturday).

I've been thinking on different ways around, shifting server clock one day ahead (so Sunday morning becomes Monday morinng for the server!) one of them.

We are using Resin Pro 3.1.9.
I conducted many experiments before I decided to write to this forum. Maybe someone had similar situations and may have found some solution to this.

Thanks for your time and hopefully suggestions.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0004231)
ferg
09-10-09 09:57

server/14a3
 

- Issue History
Date Modified Username Field Change
09-09-09 18:00 emil New Issue
09-10-09 09:57 ferg Note Added: 0004231
09-10-09 09:57 ferg Assigned To  => ferg
09-10-09 09:57 ferg Status new => closed
09-10-09 09:57 ferg Resolution open => fixed
09-10-09 09:57 ferg Fixed in Version  => 3.1.9


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker