DEV: decrease webhook timeout and move to 'low' priority queue. (#14038)

DEV: decrease webhook timeout and move to ‘low’ priority queue. (#14038)

Previously, webhooks has 60 seconds default timeout of Excon and were added in the ‘default’ queue.

diff --git a/app/jobs/regular/emit_web_hook_event.rb b/app/jobs/regular/emit_web_hook_event.rb
index 7b22f03..c291037 100644
--- a/app/jobs/regular/emit_web_hook_event.rb
+++ b/app/jobs/regular/emit_web_hook_event.rb
@@ -4,9 +4,12 @@ require 'excon'
 
 module Jobs
   class EmitWebHookEvent < ::Jobs::Base
+    sidekiq_options queue: 'low'
+
     PING_EVENT = 'ping'
     MAX_RETRY_COUNT = 4
     RETRY_BACKOFF = 5
+    REQUEST_TIMEOUT = 20
 
     def execute(args)
       @arguments = args
@@ -41,7 +44,14 @@ module Jobs
 
     def send_webhook!
       uri = URI(@web_hook.payload_url.strip)
-      conn = Excon.new(uri.to_s, ssl_verify_peer: @web_hook.verify_certificate, retry_limit: 0)
+      conn = Excon.new(
+        uri.to_s,
+        ssl_verify_peer: @web_hook.verify_certificate,
+        retry_limit: 0,
+        write_timeout: REQUEST_TIMEOUT,
+        read_timeout: REQUEST_TIMEOUT,
+        connect_timeout: REQUEST_TIMEOUT
+      )
 
       web_hook_body = build_webhook_body
       web_hook_event = create_webhook_event(web_hook_body)

GitHub sha: c75500b871f992f4508feffb73818e8b7176a22d

This commit appears in #14038 which was approved by tgxworld. It was merged by vinothkannans.