modify cache.Add
fix getIGDBID
This commit is contained in:
parent
cb68360f2f
commit
fa206a1bb7
2
cache/redis.go
vendored
2
cache/redis.go
vendored
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user