|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
package worker |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"github.com/RichardKnop/machinery/v1" |
|
|
|
mchConf "github.com/RichardKnop/machinery/v1/config" |
|
|
|
) |
|
|
|
@@ -19,9 +20,9 @@ func init() { |
|
|
|
|
|
|
|
func NewTaskCenter() (*machinery.Server, error) { |
|
|
|
cnf := &mchConf.Config{ |
|
|
|
Broker: "redis://localhost:6379", |
|
|
|
DefaultQueue: "DecompressTasksQueue", |
|
|
|
ResultBackend: "redis://localhost:6379", |
|
|
|
Broker: setting.Broker, |
|
|
|
DefaultQueue: setting.DefaultQueue, |
|
|
|
ResultBackend: setting.ResultBackend, |
|
|
|
} |
|
|
|
// Create server instance |
|
|
|
return machinery.NewServer(cnf) |
|
|
|
|