Skip to content

Instantly share code, notes, and snippets.

@perlDreamer
Created April 7, 2010 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlDreamer/358934 to your computer and use it in GitHub Desktop.
Save perlDreamer/358934 to your computer and use it in GitHub Desktop.
diff --git a/lib/WebGUI/Operation/Cron.pm b/lib/WebGUI/Operation/Cron.pm
index 7dff131..fdb8617 100644
--- a/lib/WebGUI/Operation/Cron.pm
+++ b/lib/WebGUI/Operation/Cron.pm
@@ -306,9 +306,13 @@ sub www_runCronJob {
}
# Run the instance
- $instance->start( 1 );
- $task->delete( 1 ) if ( $task->get("runOnce") );
- return "done";
+ my $error = $instance->start( 1 );
+ if ($error) {
+ $task->delete(1);
+ return "error";
+ }
+ $task->delete( 1 ) if ( $task->get("runOnce") );
+ return "done";
}
$session->errorHandler->warn("No task ID passed to cron job runner.");
return "error";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment