Permalink
Browse files

handle error while running persistent tasks

  • Loading branch information...
1 parent 6097a40 commit ffac6621a72c212f7048f955a35ad7fbf15c20d3 @gnufied committed Apr 29, 2009
Showing with 8 additions and 1 deletion.
  1. +8 −1 server/lib/meta_worker.rb
@@ -127,7 +127,14 @@ def worker_init
invoke_user_method(:create,worker_options[:data])
end
if run_persistent_jobs?
- add_periodic_timer(persistent_delay.to_i) { check_for_enqueued_tasks }
+ add_periodic_timer(persistent_delay.to_i) {
+ begin
+ check_for_enqueued_tasks
+ rescue Object => e
+ puts("Error while running persistent task : #{Time.now}")
+ log_exception(e.backtrace)
+ end
+ }
end
write_pid_file(t_worker_key)
end

0 comments on commit ffac662

Please sign in to comment.