Skip to content

Commit

Permalink
Initialize cron last (#20373) (#20384)
Browse files Browse the repository at this point in the history
Backport #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>
  • Loading branch information
zeripath committed Jul 15, 2022
1 parent 975a962 commit c91b8c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routers/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func GlobalInitInstalled(ctx context.Context) {
mustInit(repo_service.Init)

// Booting long running goroutines.
cron.NewContext(ctx)
issue_indexer.InitIssueIndexer(false)
code_indexer.Init()
mustInit(stats_indexer.Init)
Expand All @@ -160,6 +159,9 @@ func GlobalInitInstalled(ctx context.Context) {

auth.Init()
svg.Init()

// Finally start up the cron
cron.NewContext(ctx)
}

// NormalRoutes represents non install routes
Expand Down

0 comments on commit c91b8c8

Please sign in to comment.