storagenode/collect: delete piece 24 hours after expiration (#3613)

This commit is contained in:
Kaloyan Raev 2019-11-20 17:02:57 +02:00 committed by GitHub
parent b5707d1e5d
commit 6d728d6ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,10 @@ func (service *Service) Run(ctx context.Context) (err error) {
defer mon.Task()(&ctx)(&err)
return service.Loop.Run(ctx, func(ctx context.Context) error {
err := service.Collect(ctx, time.Now())
// V3-3143 Pieces should be collected at least 24 hours after expiration
// to avoid premature deletion due to timezone issues, which may lead to
// storage node disqualification.
err := service.Collect(ctx, time.Now().Add(-24*time.Hour))
if err != nil {
service.log.Error("error during collecting pieces: ", zap.Error(err))
}