20230130173733_add_taskbar_cleanup_job.rb 877 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class AddTaskbarCleanupJob < ActiveRecord::Migration[6.1]
  3. def up
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Scheduler.create_if_not_exists(
  6. name: 'Clean up mobile taskbars.',
  7. method: 'TaskbarCleanupJob.perform_now',
  8. period: 10.minutes,
  9. prio: 2,
  10. active: true,
  11. timeplan: {
  12. 'days' => {
  13. 'Mon' => true,
  14. 'Tue' => true,
  15. 'Wed' => true,
  16. 'Thu' => true,
  17. 'Fri' => true,
  18. 'Sat' => true,
  19. 'Sun' => true
  20. },
  21. 'hours' => {
  22. '1' => true
  23. },
  24. 'minutes' => {
  25. '0' => true
  26. }
  27. },
  28. updated_by_id: 1,
  29. created_by_id: 1,
  30. last_run: Time.zone.now,
  31. )
  32. end
  33. end