cli: extend logs of index file construction for upload-bin

These logs are needed to track the progress of uploaders.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-11-05 11:20:51 +03:00
parent 95098d4b25
commit 82b508e8f3

View file

@ -425,6 +425,7 @@ func uploadIndexFiles(ctx *cli.Context, p *pool.Pool, containerID cid.ID, accoun
for idx := range indexFileSize {
if _, ok := processedIndices.Load(idx); !ok {
count++
fmt.Fprintf(ctx.App.Writer, "Index file %d: fetching missing block %d\n", i, i*indexFileSize+idx)
objIDs = searchObjects(ctx.Context, p, containerID, account, blockAttributeKey, i*indexFileSize+idx, i*indexFileSize+idx+1, 1, errCh)
// Block object duplicates are allowed, we're OK with the first found result.
id, ok := <-objIDs
@ -432,7 +433,7 @@ func uploadIndexFiles(ctx *cli.Context, p *pool.Pool, containerID cid.ID, accoun
}
if !ok {
select {
case errCh <- fmt.Errorf("block %d is missing from the storage", i*indexFileSize+idx):
case errCh <- fmt.Errorf("index file %d: block %d is missing from the storage", i, i*indexFileSize+idx):
default:
}
return