调度中心嵌入cms
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
|
||||
"scheduler-backend/pkg/config"
|
||||
@@ -93,6 +94,7 @@ type Runtime struct {
|
||||
Logger log.Logger
|
||||
MetaDB *mongo.Database
|
||||
BusinessDB *mongo.Database
|
||||
Redis *redis.Client
|
||||
}
|
||||
|
||||
type Handler interface {
|
||||
|
||||
@@ -36,7 +36,9 @@ func (URLRewriteHandler) Run(ctx context.Context, runtime Runtime, req ExecuteRe
|
||||
|
||||
redisCfg := urlrewrite.RedisConfig{
|
||||
Addr: runtime.Config.RedisAddr,
|
||||
Username: runtime.Config.RedisUsername,
|
||||
Password: runtime.Config.RedisPassword,
|
||||
Client: runtime.Redis,
|
||||
}
|
||||
batchID, err := urlrewrite.Run(ctx, runtime.BusinessDB, params, redisCfg, logf)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user