This commit is contained in:
Neeraj Gupta 2024-05-16 12:52:20 +05:30
parent 4cc866fa12
commit 3f1ee82ec5
2 changed files with 3 additions and 3 deletions

View file

@ -348,7 +348,7 @@ func (c *Controller) getEmbeddingObject(ctx context.Context, objectKey string, d
// check if the error is due to object not found
if s3Err, ok := err.(awserr.RequestFailure); ok {
if s3Err.Code() == s3.ErrCodeNoSuchKey {
if c.areDerivedAndHotBucketSame {
if c.derivedStorageDataCenter == c.S3Config.GetHotDataCenter() {
ctxLogger.Error("Object not found: ", s3Err)
} else {
// If derived and hot bucket are different, try to copy from hot bucket

View file

@ -81,8 +81,8 @@ func (c *Controller) deleteEmbedding(qItem repo.QueueItem) {
ctxLogger.WithError(err).Error("Failed to delete all objects")
return
}
// if Embeddings DC is different from hot DC, delete from hot DC as well
if !c.areDerivedAndHotBucketSame {
// if Derived DC is different from hot DC, delete from hot DC as well
if c.derivedStorageDataCenter != c.S3Config.GetHotDataCenter() {
err = c.ObjectCleanupController.DeleteAllObjectsWithPrefix(prefix, c.S3Config.GetHotDataCenter())
if err != nil {
ctxLogger.WithError(err).Error("Failed to delete all objects from hot DC")