[server] Remove entry from object_keys before marking del as completed (#677)

## Description

## Tests
This commit is contained in:
Neeraj Gupta 2024-03-05 14:56:02 +05:30 committed by GitHub
parent ef553d9401
commit 3513d7a297
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -652,16 +652,16 @@ func (c *FileController) cleanupDeletedFile(qItem repo.QueueItem) {
return
}
}
err = c.QueueRepo.DeleteItem(repo.DeleteObjectQueue, qItem.Item)
if err != nil {
ctxLogger.WithError(err).Error("Failed to remove item from the queue")
return
}
err = c.ObjectRepo.RemoveObjectsForKey(qItem.Item)
if err != nil {
ctxLogger.WithError(err).Error("Failed to remove item from object_keys")
return
}
err = c.QueueRepo.DeleteItem(repo.DeleteObjectQueue, qItem.Item)
if err != nil {
ctxLogger.WithError(err).Error("Failed to remove item from the queue")
return
}
ctxLogger.Info("Successfully deleted item")
}