-
Do not use delayed jobs if your system can have 100k+ jobs at a time in delayed jobs table. It'll cause the jobs to run very slow.
-
Check conditions before adding the jobs to queue, instead of checking inside the job. This'll prevent delayed jobs table from being over-populated.
# bad class Order < ApplicationRecord after_create :send_to_webhook
def send_to_webhook