[#2068] blobstor: Allow to provide storage ID in Exists

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-11-17 09:29:35 +03:00 committed by fyrchik
parent 6ad2b5d5b8
commit 63f604e948
5 changed files with 101 additions and 4 deletions

View file

@ -10,6 +10,17 @@ import (
// Exists implements common.Storage.
func (b *Blobovniczas) Exists(prm common.ExistsPrm) (common.ExistsRes, error) {
if prm.StorageID != nil {
id := blobovnicza.NewIDFromBytes(prm.StorageID)
blz, err := b.openBlobovnicza(id.String())
if err != nil {
return common.ExistsRes{}, err
}
exists, err := blz.Exists(prm.Address)
return common.ExistsRes{Exists: exists}, err
}
activeCache := make(map[string]struct{})
var gPrm blobovnicza.GetPrm