Last active
November 4, 2022 18:23
-
-
Save pablo-co/55fa50b630cb7ce0d79e0fdb9ec04386 to your computer and use it in GitHub Desktop.
Reprogramar notificaciones en ventana larga de tiempo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger_ids = %w[ | |
| ] | |
| trigger_ids.each do |id| | |
| trigger = Trigger.find(id) | |
| search_id = trigger.templates.where(template_type: "EmailTemplate").first.id | |
| job = Delayed::Job.where(queue: "delivery_notification_job").where("handler ilike ?", "%#{search_id}%").first | |
| job.update(run_at: Time.now + rand(60..1440).minutes) # 1 hour to 24 hours in the future. | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment