From 3513d7a2976318c476ab3999c04fc59744ed118d Mon Sep 17 00:00:00 2001 From: Neeraj Gupta Date: Tue, 5 Mar 2024 14:56:02 +0530 Subject: [PATCH] [server] Remove entry from object_keys before marking del as completed (#677) ## Description ## Tests --- server/pkg/controller/file.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/pkg/controller/file.go b/server/pkg/controller/file.go index 198d850fd..1323ee4c0 100644 --- a/server/pkg/controller/file.go +++ b/server/pkg/controller/file.go @@ -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") }