From 53202e5711f32c80ec89d149da7de72b2a1fc953 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 4 Mar 2011 15:52:13 +0000 Subject: Added some extra functions to Bu::MiniCron to let you execute jobs that are in the queue immediately, with or without rescheduling, by id or name. --- src/minicron.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/minicron.h') diff --git a/src/minicron.h b/src/minicron.h index 7ccf543..0d1cb62 100644 --- a/src/minicron.h +++ b/src/minicron.h @@ -110,6 +110,22 @@ namespace Bu */ virtual void removeJob( JobId jid ); + /** + * Executes the job specified right now. If bReschedule is true then + * the job is then removed from the queue and rescheduled as though + * it's time had come naturally to be run. Otherwise, it's run without + * interrupting the normal schedule. + */ + virtual void runJob( JobId jid, bool bReschedule=false ); + + /** + * Executes the job specified right now. If bReschedule is true then + * the job is then removed from the queue and rescheduled as though + * it's time had come naturally to be run. Otherwise, it's run without + * interrupting the normal schedule. + */ + virtual void runJob( const Bu::String &sName, bool bReschedule=false ); + class JobInfo { public: @@ -234,7 +250,7 @@ namespace Bu * Execute this job once, increment the runcount and schedule the * next occurance of it. */ - void run(); + void run( bool bReschedule=true ); /** * Get the time this job will next run. -- cgit v1.2.3