Can I handle Job execution On/Off over application.conf?

211 views
Skip to first unread message

ikeike443

unread,
Aug 11, 2010, 7:46:53 AM8/11/10
to play-framework, ikei...@gmail.com
Hi,

I would like to handle my job execution On/Off, then I read framework
code such as play.jobs.JobsPlugin, play.libs.Time and so on.
I knew it is able to handle job schedule over application.conf as
Calimoucho do, set string start with prefix "cron".

I tried to set "cron.interval=0min" for turn off job execution, of
course it was annotated "@Every("cron.interval")".
But I was caught by Exception from
java.util.concurrent.ScheduledThreadPoolExecutor becauce it was
prohibited to set 0 value to delay variable.

Is there another way? Or Is it scheduled on Playframework's road map
to handle Job execution On/Off over application.conf?

Thanks,
ikeike443

ikeike443

unread,
Aug 11, 2010, 8:00:39 AM8/11/10
to play-framework
Or shoud I write another plugin?

Guillaume Bort

unread,
Aug 11, 2010, 10:08:11 AM8/11/10
to play-fr...@googlegroups.com
I think that it would be better than @Cron and @Every support the '0'
or 'never' value. If you can patch the JobsPlugin in the 1.1 branch to
do that, I will integrate it for the next release.

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,
write guillau...@gmail.com

ikeike443

unread,
Aug 12, 2010, 2:22:34 AM8/12/10
to play-framework
OK, I will try it as soon as possible.
> Guillaume Bort,http://guillaume.bort.fr
>
> For anything work-related, use g...@zenexity.fr; for everything else,
> write guillaume.b...@gmail.com

ikeike443

unread,
Aug 25, 2010, 3:19:19 AM8/25/10
to play-framework
Hi, Guillaume

Sorry to send back too late, because I've got involved in a kind of
trouble shooting on my day-job.... ;-)

Anyway, I wrote a tiny patch for play-1.1 JobsPlugin as below link.
http://gist.github.com/547537

I was not sure why the statement "if(value.startsWith("cron."))..."
was eliminated from @Every section in afterApplicationStart method,
but not from @On section in scheduleForCRON method, I added the
statement onto @Every section.

But, I wonder it is better to eliminate the statement from @On section
than that.
I think play.libs.Expression suggest it is better.. and using "$
{cron.something}" value is rather better too.

Do you think?

And also I want to take a patch for play-1.0.x as below.
http://gist.github.com/547437

Thanks,
ikeike443

On 8月11日, 午後11:08, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> I think that it would be better than @Cron and @Every support the '0'
> or 'never' value. If you can patch the JobsPlugin in the 1.1 branch to
> do that, I will integrate it for the next release.
>
>
>
>
>
> On Wed, Aug 11, 2010 at 2:00 PM, ikeike443 <ikeike...@gmail.com> wrote:
> > Or shoud I write another plugin?
>
> > On 8月11日, 午後8:46, ikeike443 <ikeike...@gmail.com> wrote:
> >> Hi,
>
> >> I would like tohandlemyjobexecution On/Off, then I read framework
> >> code such as play.jobs.JobsPlugin, play.libs.Time and so on.
> >> I knew it is able tohandlejobschedule over application.conf as
> >> Calimoucho do, set string start with prefix "cron".
>
> >> I tried to set "cron.interval=0min" for turn offjobexecution, of
> >> course it was annotated "@Every("cron.interval")".
> >> But I was caught by Exception from
> >> java.util.concurrent.ScheduledThreadPoolExecutor becauce it was
> >> prohibited to set 0 value to delay variable.
>
> >> Is there another way? Or Is it scheduled on Playframework's road map
> >> tohandleJobexecution On/Off over application.conf?
>
> >> Thanks,
> >> ikeike443
>
> > --
> > You received this message because you are subscribed to the Google Groups "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/play-framework?hl=en.
>
> --
> Guillaume Bort,http://guillaume.bort.fr
>
> For anything work-related, use g...@zenexity.fr; for everything else,
> write guillaume.b...@gmail.com

Guillaume Bort

unread,
Aug 27, 2010, 3:45:44 AM8/27/10
to play-fr...@googlegroups.com
Hi,

Fixed in 1.1 trunk. Can you check my patch?

> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,

write guillau...@gmail.com

ikeike443

unread,
Aug 27, 2010, 4:13:25 AM8/27/10
to play-framework
Hi,
Thank you very much.
I'll check it. Fixed revision is 1021?
http://bazaar.launchpad.net/~play-developers/play/1.1-unstable/revision/1021

thanks,
ikeike443
Reply all
Reply to author
Forward
0 new messages