From da80d0c78906bb02690aab89d57a5dd304fcf2e7 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 8 Jun 2022 10:24:10 -0500 Subject: [PATCH] Throttle notification processing to prevent starvation --- sgx_jmp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index b6a3b938377a833ffbd743e23cde6ab91818d007..f873cd2900b75d0e414f88d2b5039731d1087edd 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -210,7 +210,7 @@ def poll_for_notify(db) DbNotification.for(notify, customer, repo) end }.then(&:call).then { - poll_for_notify(db) + EM.add_timer(0.5) { poll_for_notify(db) } }.catch(&method(:panic)) end