storagenode/pieces: make log more legible

This commit is contained in:
nerdatwork 2020-09-18 17:40:13 +05:30 committed by GitHub
parent 92a336cb5a
commit 96ec44ff1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,12 +53,12 @@ func (service *CacheService) Run(ctx context.Context) (err error) {
// recalculate the cache once
piecesTotal, piecesContentSize, totalsBySatellite, err := service.store.SpaceUsedTotalAndBySatellite(ctx)
if err != nil {
service.log.Error("error getting current space used calculation: ", zap.Error(err))
service.log.Error("error getting current used space: ", zap.Error(err))
return err
}
trashTotal, err := service.usageCache.Blobs.SpaceUsedForTrash(ctx)
if err != nil {
service.log.Error("error getting current space for trash: ", zap.Error(err))
service.log.Error("error getting current used space for trash: ", zap.Error(err))
return err
}
service.usageCache.Recalculate(
@ -231,7 +231,7 @@ func (blobs *BlobsUsageCache) Delete(ctx context.Context, blobRef storage.BlobRe
return err
}
blobs.Update(ctx, satelliteID, -pieceTotal, -pieceContentSize, 0)
blobs.log.Debug("deleted piece", zap.String("satelliteID", satelliteID.String()), zap.Int64("space was freed", pieceContentSize))
blobs.log.Debug("deleted piece", zap.String("Satellite ID", satelliteID.String()), zap.Int64("disk space freed in bytes", pieceContentSize))
return nil
}