schedulers.rb 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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: __('Execute planned jobs.'),
  43. method: 'Job.run',
  44. period: 5.minutes,
  45. prio: 2,
  46. active: true,
  47. updated_by_id: 1,
  48. created_by_id: 1,
  49. )
  50. Scheduler.create_if_not_exists(
  51. name: __('Clean up expired sessions.'),
  52. method: 'SessionHelper.cleanup_expired',
  53. period: 60 * 60 * 12,
  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: __('Delete old activity stream entries.'),
  61. method: 'ActivityStream.cleanup',
  62. period: 1.day,
  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 'RecentView' entries."),
  70. method: 'RecentView.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_or_update(
  78. name: __('Delete old online notification entries.'),
  79. method: 'OnlineNotification.cleanup',
  80. period: 2.hours,
  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 token entries.'),
  88. method: 'Token.cleanup',
  89. period: 30.days,
  90. prio: 2,
  91. active: true,
  92. updated_by_id: 1,
  93. created_by_id: 1,
  94. )
  95. Scheduler.create_or_update(
  96. name: __('Close chat sessions where participants are offline.'),
  97. method: 'Chat.cleanup_close',
  98. period: 15.minutes,
  99. prio: 2,
  100. active: true,
  101. updated_by_id: 1,
  102. created_by_id: 1,
  103. )
  104. Scheduler.create_or_update(
  105. name: __('Clean up closed sessions.'),
  106. method: 'Chat.cleanup',
  107. period: 5.days,
  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 ActiveJob locks.'),
  115. method: 'ActiveJobLockCleanupJob.perform_now',
  116. period: 1.day,
  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 dead sessions.'),
  124. method: 'SessionTimeoutJob.perform_now',
  125. period: 1.hour,
  126. prio: 2,
  127. active: true,
  128. updated_by_id: 1,
  129. created_by_id: 1,
  130. )
  131. Scheduler.create_or_update(
  132. name: __('Sync calendars with iCal feeds.'),
  133. method: 'Calendar.sync',
  134. period: 1.day,
  135. prio: 2,
  136. active: true,
  137. updated_by_id: 1,
  138. created_by_id: 1,
  139. )
  140. Scheduler.create_or_update(
  141. name: __('Generate user-based stats.'),
  142. method: 'Stats.generate',
  143. period: 11.minutes,
  144. prio: 2,
  145. active: true,
  146. updated_by_id: 1,
  147. created_by_id: 1,
  148. )
  149. Scheduler.create_or_update(
  150. name: __('Delete old stats store entries.'),
  151. method: 'StatsStore.cleanup',
  152. period: 31.days,
  153. prio: 2,
  154. active: true,
  155. updated_by_id: 1,
  156. created_by_id: 1,
  157. )
  158. Scheduler.create_if_not_exists(
  159. name: __("Clean up 'HttpLog'."),
  160. method: 'HttpLog.cleanup',
  161. period: 1.day,
  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 'Cti::Log'."),
  169. method: 'Cti::Log.cleanup',
  170. period: 1.month,
  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 'DataPrivacyTask'."),
  178. method: 'DataPrivacyTask.cleanup',
  179. period: 1.day,
  180. prio: 2,
  181. active: true,
  182. updated_by_id: 1,
  183. created_by_id: 1,
  184. )
  185. Scheduler.create_or_update(
  186. name: __('Delete obsolete classic IMAP backup.'),
  187. method: 'ImapAuthenticationMigrationCleanupJob.perform_now',
  188. period: 1.day,
  189. prio: 2,
  190. active: true,
  191. updated_by_id: 1,
  192. created_by_id: 1,
  193. )
  194. Scheduler.create_if_not_exists(
  195. name: __('Execute import jobs.'),
  196. method: 'ImportJob.start_registered',
  197. period: 1.hour,
  198. prio: 1,
  199. active: true,
  200. updated_by_id: 1,
  201. created_by_id: 1
  202. )
  203. Scheduler.create_if_not_exists(
  204. name: __('Handle data privacy tasks.'),
  205. method: 'DataPrivacyTaskJob.perform_now',
  206. period: 10.minutes,
  207. last_run: Time.zone.now,
  208. prio: 2,
  209. active: true,
  210. updated_by_id: 1,
  211. created_by_id: 1,
  212. )
  213. Scheduler.create_if_not_exists(
  214. name: __('Delete old upload cache entries.'),
  215. method: 'UploadCacheCleanupJob.perform_now',
  216. period: 1.month,
  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: __('Clean up cache.'),
  224. method: 'CacheClearJob.perform_now',
  225. period: 10.minutes,
  226. prio: 2,
  227. active: true,
  228. timeplan: {
  229. 'days' => {
  230. 'Mon' => true,
  231. 'Tue' => true,
  232. 'Wed' => true,
  233. 'Thu' => true,
  234. 'Fri' => true,
  235. 'Sat' => true,
  236. 'Sun' => true
  237. },
  238. 'hours' => {
  239. '23' => true
  240. },
  241. 'minutes' => {
  242. '0' => true
  243. }
  244. },
  245. updated_by_id: 1,
  246. created_by_id: 1,
  247. )
  248. Scheduler.create_if_not_exists(
  249. name: __('Update exchange oauth 2 token.'),
  250. method: 'ExternalCredential::Exchange.refresh_token',
  251. period: 10.minutes,
  252. prio: 1,
  253. active: true,
  254. updated_by_id: 1,
  255. created_by_id: 1,
  256. )
  257. Scheduler.create_if_not_exists(
  258. name: __('Clean up mobile taskbars.'),
  259. method: 'TaskbarCleanupJob.perform_now',
  260. period: 10.minutes,
  261. prio: 2,
  262. active: true,
  263. timeplan: {
  264. 'days' => {
  265. 'Mon' => true,
  266. 'Tue' => true,
  267. 'Wed' => true,
  268. 'Thu' => true,
  269. 'Fri' => true,
  270. 'Sat' => true,
  271. 'Sun' => true
  272. },
  273. 'hours' => {
  274. '1' => true
  275. },
  276. 'minutes' => {
  277. '0' => true
  278. }
  279. },
  280. updated_by_id: 1,
  281. created_by_id: 1,
  282. )