feat: optimize exists to check multiple keys in one call

* closes #32
This commit is contained in:
2024-10-04 12:19:26 +03:00
parent 55159196f4
commit 50870f10cf
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
}