diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 2174ababd8c6a4f98688adf5214b3a2bbbc3a1c0..6fdf2fe3f575d688e9e3527cf6147508e1a60731 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -185,9 +185,10 @@ def poll_for_notify(db) repo.find(notify[:extra]).then do |customer| DbNotification.for(notify, customer, repo) end - }.then(&:call).then { - EM.add_timer(0.5) { poll_for_notify(db) } - }.catch(&method(:panic)) + }.then(&:call).catch { |e| + log.fatal("Error during poll_for_notify", e) + Sentry.capture_exception(e) + }.then { EM.add_timer(0.5) { poll_for_notify(db) } } end def load_plans_to_db!