Skip to content

Commit

Permalink
handle error while running persistent tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
gnufied committed Apr 29, 2009
1 parent 6097a40 commit ffac662
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/lib/meta_worker.rb
Expand Up @@ -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
Expand Down

0 comments on commit ffac662

Please sign in to comment.