重构项目结构,将 orm 和 rds 包迁移到 web/globals

This commit is contained in:
2025-05-10 16:59:41 +08:00
parent 37e6e58816
commit d256359681
60 changed files with 363 additions and 349 deletions

View File

@@ -10,14 +10,13 @@ import (
"math"
"math/rand/v2"
"platform/pkg/env"
"platform/pkg/orm"
"platform/pkg/rds"
"platform/pkg/u"
"platform/web/auth"
"platform/web/core"
channel2 "platform/web/domains/channel"
proxy2 "platform/web/domains/proxy"
g "platform/web/globals"
"platform/web/globals/orm"
m "platform/web/models"
q "platform/web/queries"
"strconv"
@@ -652,7 +651,7 @@ func cache(ctx context.Context, channels []*m.Channel) error {
return nil
}
pipe := rds.Client.TxPipeline()
pipe := g.Redis.TxPipeline()
zList := make([]redis.Z, 0, len(channels))
for _, channel := range channels {
@@ -686,7 +685,7 @@ func deleteCache(ctx context.Context, channels []*m.Channel) error {
for i := range channels {
keys[i] = chKey(channels[i])
}
_, err := rds.Client.Del(ctx, keys...).Result()
_, err := g.Redis.Del(ctx, keys...).Result()
if err != nil {
return err
}