Skip to content

Commit d67118e

Browse files
zeripathSysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Initialize cron last (go-gitea#20373)
Cron will try to run certain things at startup but these depend on multiple things being set-up. Therefore we should initialize cron last. Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 663e323 commit d67118e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routers/init.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ func GlobalInitInstalled(ctx context.Context) {
141141
mustInit(repo_service.Init)
142142

143143
// Booting long running goroutines.
144-
cron.NewContext(ctx)
145144
issue_indexer.InitIssueIndexer(false)
146145
code_indexer.Init()
147146
mustInit(stats_indexer.Init)
@@ -160,6 +159,9 @@ func GlobalInitInstalled(ctx context.Context) {
160159

161160
auth.Init()
162161
svg.Init()
162+
163+
// Finally start up the cron
164+
cron.NewContext(ctx)
163165
}
164166

165167
// NormalRoutes represents non install routes

0 commit comments

Comments
 (0)