feat: optimize exists to check multiple keys in one call (#40)

* closes #32
This commit is contained in:
2024-10-07 10:07:11 +03:00
committed by GitHub
parent fd59d286f5
commit f1086fcdc1
4 changed files with 13 additions and 14 deletions

View File

@@ -147,16 +147,10 @@ func (hc *HandlerContainer) checkStables(ctx context.Context, from string, to st
return true, nil
}
// TODO: Pipeline this check on Redis with a new method
fromExists, err := hc.cache.Exists(ctx, from)
exists, err := hc.cache.Exists(ctx, from, to)
if err != nil {
return false, err
}
toExists, err := hc.cache.Exists(ctx, to)
if err != nil {
return false, err
}
return fromExists || toExists, nil
return exists, nil
}