File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,6 @@ func initActionsTasks() {
21
21
registerScheduleTasks ()
22
22
}
23
23
24
- func registerScheduleTasks () {
25
- RegisterTaskFatal ("start_schedule_tasks" , & BaseConfig {
26
- Enabled : true ,
27
- RunAtStart : false ,
28
- Schedule : "@every 1m" ,
29
- }, func (ctx context.Context , _ * user_model.User , cfg Config ) error {
30
- return actions_service .StartScheduleTasks (ctx )
31
- })
32
- }
33
-
34
24
func registerStopZombieTasks () {
35
25
RegisterTaskFatal ("stop_zombie_tasks" , & BaseConfig {
36
26
Enabled : true ,
@@ -60,3 +50,16 @@ func registerCancelAbandonedJobs() {
60
50
return actions_service .CancelAbandonedJobs (ctx )
61
51
})
62
52
}
53
+
54
+ // registerScheduleTasks registers a scheduled task that runs every minute to start any due schedule tasks.
55
+ func registerScheduleTasks () {
56
+ // Register the task with a unique name, enabled status, and schedule for every minute.
57
+ RegisterTaskFatal ("start_schedule_tasks" , & BaseConfig {
58
+ Enabled : true ,
59
+ RunAtStart : false ,
60
+ Schedule : "@every 1m" ,
61
+ }, func (ctx context.Context , _ * user_model.User , cfg Config ) error {
62
+ // Call the function to start schedule tasks and pass the context.
63
+ return actions_service .StartScheduleTasks (ctx )
64
+ })
65
+ }
You can’t perform that action at this time.
0 commit comments