From 1bf259afebad1e3a393713113434634d98aaf952 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Thu, 14 Jul 2022 15:45:01 +0100 Subject: [PATCH] Initialize cron last 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 --- routers/init.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routers/init.go b/routers/init.go index 72ccf3526c1fb..e640ca48453bc 100644 --- a/routers/init.go +++ b/routers/init.go @@ -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) @@ -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