From 7ede275e400230203879d5348243ceefe3fffa60 Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Tue, 18 Aug 2020 15:02:58 +0800 Subject: [PATCH] fix 51 --- custom/conf/app.ini.sample | 2 ++ main.go | 1 - modules/worker/worker.go | 2 +- routers/init.go | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 routers/init.go diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index 0c4d99206..ad3f3f7cf 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -753,6 +753,8 @@ MINIO_LOCATION = us-east-1 MINIO_BASE_PATH = attachments/ ; Minio enabled ssl only available when STORE_TYPE is `minio` MINIO_USE_SSL = false +; real Minio storage path +MINIO_REAL_PATH = /mnt/test/minio/data/ [time] ; Specifies the format for fully outputted dates. Defaults to RFC1123 diff --git a/main.go b/main.go index e25ce18b1..297bb24f7 100755 --- a/main.go +++ b/main.go @@ -22,7 +22,6 @@ import ( _ "code.gitea.io/gitea/modules/markup/markdown" _ "code.gitea.io/gitea/modules/markup/orgmode" _ "code.gitea.io/gitea/modules/timer" - _ "code.gitea.io/gitea/modules/worker" "github.com/urfave/cli" ) diff --git a/modules/worker/worker.go b/modules/worker/worker.go index 25bf0cb4c..ab44d2472 100755 --- a/modules/worker/worker.go +++ b/modules/worker/worker.go @@ -10,7 +10,7 @@ var ( AsyncTaskCenter *machinery.Server ) -func init() { +func Init() { tc, err := NewTaskCenter() if err != nil { panic(err) diff --git a/routers/init.go b/routers/init.go old mode 100644 new mode 100755 index f899e8ad9..c2b6da92a --- a/routers/init.go +++ b/routers/init.go @@ -31,6 +31,7 @@ import ( "code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/task" "code.gitea.io/gitea/modules/webhook" + "code.gitea.io/gitea/modules/worker" "code.gitea.io/gitea/services/mailer" mirror_service "code.gitea.io/gitea/services/mirror" pull_service "code.gitea.io/gitea/services/pull" @@ -61,6 +62,7 @@ func NewServices() { mailer.NewContext() _ = cache.NewContext() notification.NewContext() + worker.Init() } // In case of problems connecting to DB, retry connection. Eg, PGSQL in Docker Container on Synology