modify cache.Add
All checks were successful
docker / prepare-and-build (push) Successful in 2m56s
release / goreleaser (push) Successful in 24m32s

fix getIGDBID
This commit is contained in:
Nite07 2024-11-24 12:34:36 +08:00
parent cb68360f2f
commit fa206a1bb7
5 changed files with 5 additions and 5 deletions

2
cache/redis.go vendored
View File

@ -72,7 +72,7 @@ func Get(key string) (string, bool) {
func Add(key string, value interface{}) error {
CheckConnect()
ctx := context.Background()
cmd := cache.Set(ctx, key, value, 7*24*time.Hour)
cmd := cache.Set(ctx, key, value, 0)
return cmd.Err()
}

View File

@ -35,7 +35,7 @@ func organizeRun(cmd *cobra.Command, args []string) {
for _, game := range games {
err := crawler.OrganizeGameItem(game)
if err != nil {
log.Logger.Error("failed to organize game item")
log.Logger.Error("failed to organize game item", zap.String("name", game.Name), zap.Error(err))
continue
}
log.Logger.Info("game item organized", zap.String("name", game.Name))

View File

@ -60,7 +60,7 @@ func getIGDBID(name string) (int, error) {
return 0, fmt.Errorf("failed to unmarshal: %w, %s", err, debug.Stack())
}
if len(data) == 1 {
return data[0].Game, nil
return GetIGDBAppParentCache(data[0].Game)
}
maxSimilairty := 0.0
maxSimilairtyIndex := 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long