From 91fa0eb9d7b8c1bb5afac9d68161cf95ae0a02f8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 24 Feb 2023 18:23:13 +0800 Subject: Avoid warning for system setting when start up (#23054) Partially fix #23050 After #22294 merged, it always has a warning log like `cannot get context cache` when starting up. This should not affect any real life but it's annoying. This PR will fix the problem. That means when starting up, getting the system settings will not try from the cache but will read from the database directly. --------- Co-authored-by: Lauris BH --- models/unittest/testdb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models/unittest') diff --git a/models/unittest/testdb.go b/models/unittest/testdb.go index 7e327f2bd2..2bc41084ba 100644 --- a/models/unittest/testdb.go +++ b/models/unittest/testdb.go @@ -113,7 +113,7 @@ func MainTest(m *testing.M, testOpts *TestOptions) { if err = storage.Init(); err != nil { fatalTestError("storage.Init: %v\n", err) } - if err = system_model.Init(); err != nil { + if err = system_model.Init(db.DefaultContext); err != nil { fatalTestError("models.Init: %v\n", err) } -- cgit v1.2.3