schedulers.rb 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. Scheduler.create_if_not_exists(
  3. name: __('Process pending tickets.'),
  4. method: 'Ticket.process_pending',
  5. period: 15.minutes,
  6. prio: 1,
  7. active: true,
  8. )
  9. Scheduler.create_if_not_exists(
  10. name: __('Process ticket escalations.'),
  11. method: 'Ticket.process_escalation',
  12. period: 5.minutes,
  13. prio: 1,
  14. active: true,
  15. )
  16. Scheduler.create_if_not_exists(
  17. name: __('Process automatic ticket unassignments.'),
  18. method: 'Ticket.process_auto_unassign',
  19. period: 10.minutes,
  20. prio: 1,
  21. active: true,
  22. )
  23. Scheduler.create_if_not_exists(
  24. name: __('Check channels.'),
  25. method: 'Channel.fetch',
  26. period: 30.seconds,
  27. prio: 1,
  28. active: true,
  29. updated_by_id: 1,
  30. created_by_id: 1,
  31. )
  32. Scheduler.create_if_not_exists(
  33. name: __("Check 'Channel' streams."),
  34. method: 'Channel.stream',
  35. period: 60.seconds,
  36. prio: 1,
  37. active: true,
  38. updated_by_id: 1,
  39. created_by_id: 1,
  40. )
  41. Scheduler.create_if_not_exists(
  42. name: __("Generate 'Session' data."),
  43. method: 'Sessions.jobs',
  44. period: 60.seconds,
  45. prio: 1,
  46. active: true,
  47. updated_by_id: 1,
  48. created_by_id: 1,
  49. )
  50. Scheduler.create_if_not_exists(
  51. name: __('Execute planned jobs.'),
  52. method: 'Job.run',
  53. period: 5.minutes,
  54. prio: 2,
  55. active: true,
  56. updated_by_id: 1,
  57. created_by_id: 1,
  58. )
  59. Scheduler.create_if_not_exists(
  60. name: __('Clean up expired sessions.'),
  61. method: 'SessionHelper.cleanup_expired',
  62. period: 60 * 60 * 12,
  63. prio: 2,
  64. active: true,
  65. updated_by_id: 1,
  66. created_by_id: 1,
  67. )
  68. Scheduler.create_if_not_exists(
  69. name: __('Delete old activity stream entries.'),
  70. method: 'ActivityStream.cleanup',
  71. period: 1.day,
  72. prio: 2,
  73. active: true,
  74. updated_by_id: 1,
  75. created_by_id: 1,
  76. )
  77. Scheduler.create_if_not_exists(
  78. name: __("Delete old 'RecentView' entries."),
  79. method: 'RecentView.cleanup',
  80. period: 1.day,
  81. prio: 2,
  82. active: true,
  83. updated_by_id: 1,
  84. created_by_id: 1,
  85. )
  86. Scheduler.create_or_update(
  87. name: __('Delete old online notification entries.'),
  88. method: 'OnlineNotification.cleanup',
  89. period: 2.hours,
  90. prio: 2,
  91. active: true,
  92. updated_by_id: 1,
  93. created_by_id: 1,
  94. )
  95. Scheduler.create_or_update(
  96. name: __('Delete old token entries.'),
  97. method: 'Token.cleanup',
  98. period: 30.days,
  99. prio: 2,
  100. active: true,
  101. updated_by_id: 1,
  102. created_by_id: 1,
  103. )
  104. Scheduler.create_or_update(
  105. name: __('Close chat sessions where participants are offline.'),
  106. method: 'Chat.cleanup_close',
  107. period: 15.minutes,
  108. prio: 2,
  109. active: true,
  110. updated_by_id: 1,
  111. created_by_id: 1,
  112. )
  113. Scheduler.create_or_update(
  114. name: __('Clean up closed sessions.'),
  115. method: 'Chat.cleanup',
  116. period: 5.days,
  117. prio: 2,
  118. active: true,
  119. updated_by_id: 1,
  120. created_by_id: 1,
  121. )
  122. Scheduler.create_or_update(
  123. name: __('Clean up ActiveJob locks.'),
  124. method: 'ActiveJobLockCleanupJob.perform_now',
  125. period: 1.day,
  126. prio: 2,
  127. active: true,
  128. updated_by_id: 1,
  129. created_by_id: 1,
  130. )
  131. Scheduler.create_or_update(
  132. name: __('Clean up dead sessions.'),
  133. method: 'SessionTimeoutJob.perform_now',
  134. period: 1.hour,
  135. prio: 2,
  136. active: true,
  137. updated_by_id: 1,
  138. created_by_id: 1,
  139. )
  140. Scheduler.create_or_update(
  141. name: __('Sync calendars with iCal feeds.'),
  142. method: 'Calendar.sync',
  143. period: 1.day,
  144. prio: 2,
  145. active: true,
  146. updated_by_id: 1,
  147. created_by_id: 1,
  148. )
  149. Scheduler.create_or_update(
  150. name: __('Generate user-based stats.'),
  151. method: 'Stats.generate',
  152. period: 11.minutes,
  153. prio: 2,
  154. active: true,
  155. updated_by_id: 1,
  156. created_by_id: 1,
  157. )
  158. Scheduler.create_or_update(
  159. name: __('Delete old stats store entries.'),
  160. method: 'StatsStore.cleanup',
  161. period: 31.days,
  162. prio: 2,
  163. active: true,
  164. updated_by_id: 1,
  165. created_by_id: 1,
  166. )
  167. Scheduler.create_if_not_exists(
  168. name: __("Clean up 'HttpLog'."),
  169. method: 'HttpLog.cleanup',
  170. period: 1.day,
  171. prio: 2,
  172. active: true,
  173. updated_by_id: 1,
  174. created_by_id: 1,
  175. )
  176. Scheduler.create_if_not_exists(
  177. name: __("Clean up 'Cti::Log'."),
  178. method: 'Cti::Log.cleanup',
  179. period: 1.month,
  180. prio: 2,
  181. active: true,
  182. updated_by_id: 1,
  183. created_by_id: 1,
  184. )
  185. Scheduler.create_if_not_exists(
  186. name: __("Clean up 'DataPrivacyTask'."),
  187. method: 'DataPrivacyTask.cleanup',
  188. period: 1.day,
  189. prio: 2,
  190. active: true,
  191. updated_by_id: 1,
  192. created_by_id: 1,
  193. )
  194. Scheduler.create_or_update(
  195. name: __('Delete obsolete classic IMAP backup.'),
  196. method: 'ImapAuthenticationMigrationCleanupJob.perform_now',
  197. period: 1.day,
  198. prio: 2,
  199. active: true,
  200. updated_by_id: 1,
  201. created_by_id: 1,
  202. )
  203. Scheduler.create_if_not_exists(
  204. name: __('Execute import jobs.'),
  205. method: 'ImportJob.start_registered',
  206. period: 1.hour,
  207. prio: 1,
  208. active: true,
  209. updated_by_id: 1,
  210. created_by_id: 1
  211. )
  212. Scheduler.create_if_not_exists(
  213. name: __('Handle data privacy tasks.'),
  214. method: 'DataPrivacyTaskJob.perform_now',
  215. period: 10.minutes,
  216. last_run: Time.zone.now,
  217. prio: 2,
  218. active: true,
  219. updated_by_id: 1,
  220. created_by_id: 1,
  221. )
  222. Scheduler.create_if_not_exists(
  223. name: __('Delete old upload cache entries.'),
  224. method: 'UploadCacheCleanupJob.perform_now',
  225. period: 1.month,
  226. prio: 2,
  227. active: true,
  228. updated_by_id: 1,
  229. created_by_id: 1,
  230. )
  231. Scheduler.create_if_not_exists(
  232. name: __('Clean up cache.'),
  233. method: 'CacheClearJob.perform_now',
  234. period: 10.minutes,
  235. prio: 2,
  236. active: true,
  237. timeplan: {
  238. 'days' => {
  239. 'Mon' => true,
  240. 'Tue' => true,
  241. 'Wed' => true,
  242. 'Thu' => true,
  243. 'Fri' => true,
  244. 'Sat' => true,
  245. 'Sun' => true
  246. },
  247. 'hours' => {
  248. '23' => true
  249. },
  250. 'minutes' => {
  251. '0' => true
  252. }
  253. },
  254. updated_by_id: 1,
  255. created_by_id: 1,
  256. )
  257. Scheduler.create_if_not_exists(
  258. name: __('Update exchange oauth 2 token.'),
  259. method: 'ExternalCredential::Exchange.refresh_token',
  260. period: 10.minutes,
  261. prio: 1,
  262. active: true,
  263. updated_by_id: 1,
  264. created_by_id: 1,
  265. )
  266. Scheduler.create_if_not_exists(
  267. name: __('Clean up mobile taskbars.'),
  268. method: 'TaskbarCleanupJob.perform_now',
  269. period: 10.minutes,
  270. prio: 2,
  271. active: true,
  272. timeplan: {
  273. 'days' => {
  274. 'Mon' => true,
  275. 'Tue' => true,
  276. 'Wed' => true,
  277. 'Thu' => true,
  278. 'Fri' => true,
  279. 'Sat' => true,
  280. 'Sun' => true
  281. },
  282. 'hours' => {
  283. '1' => true
  284. },
  285. 'minutes' => {
  286. '0' => true
  287. }
  288. },
  289. updated_by_id: 1,
  290. created_by_id: 1,
  291. )