Skip to content

Instantly share code, notes, and snippets.

@pablo-co
Last active November 4, 2022 18:23
Show Gist options
  • Select an option

  • Save pablo-co/55fa50b630cb7ce0d79e0fdb9ec04386 to your computer and use it in GitHub Desktop.

Select an option

Save pablo-co/55fa50b630cb7ce0d79e0fdb9ec04386 to your computer and use it in GitHub Desktop.
Reprogramar notificaciones en ventana larga de tiempo
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