mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-29 04:07:17 +00:00
not return entry if failed to delete
This commit is contained in:
+4
-4
@@ -355,16 +355,16 @@ func (f *Filer) FindEntry(ctx context.Context, p util.FullPath) (entry *Entry, e
|
||||
if entry.GetS3ExpireTime().Before(time.Now()) && !entry.IsS3Versioning() {
|
||||
if delErr := f.doDeleteEntryMetaAndData(ctx, entry, true, false, nil); delErr != nil {
|
||||
glog.ErrorfCtx(ctx, "FindEntry doDeleteEntryMetaAndData %s failed: %v", entry.FullPath, delErr)
|
||||
// Deletion failed - return entry as still existing rather than claiming it's gone
|
||||
return entry, nil
|
||||
// Return error to prevent serving expired content (safer than returning the entry)
|
||||
return nil, fmt.Errorf("failed to delete expired entry %s: %w", entry.FullPath, delErr)
|
||||
}
|
||||
return nil, filer_pb.ErrNotFound
|
||||
}
|
||||
} else if entry.Crtime.Add(time.Duration(entry.TtlSec) * time.Second).Before(time.Now()) {
|
||||
if delErr := f.Store.DeleteOneEntry(ctx, entry); delErr != nil {
|
||||
glog.ErrorfCtx(ctx, "FindEntry DeleteOneEntry %s failed: %v", entry.FullPath, delErr)
|
||||
// Deletion failed - return entry as still existing rather than claiming it's gone
|
||||
return entry, nil
|
||||
// Return error to prevent serving expired content (safer than returning the entry)
|
||||
return nil, fmt.Errorf("failed to delete expired entry %s: %w", entry.FullPath, delErr)
|
||||
}
|
||||
return nil, filer_pb.ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user