Skip to content

Commit e9b344e

Browse files
committed
Some cleanup
1 parent 1c9e8b4 commit e9b344e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Exceptionless/Extensions/FileStorageExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ public static bool ReleaseFile(this IObjectStorage storage, ObjectInfo info) {
8888

8989
public static void ReleaseStaleLocks(this IObjectStorage storage, string queueName, TimeSpan? maxLockAge = null) {
9090
if (!maxLockAge.HasValue)
91-
maxLockAge = TimeSpan.FromMinutes(60);
91+
maxLockAge = TimeSpan.FromHours(1);
9292

93-
foreach (var file in storage.GetObjectList(Path.Combine(queueName, "q", "*.x"), 500).ToList().Where(f => f.Modified < DateTime.Now.Subtract(maxLockAge.Value)))
93+
var files = storage.GetObjectList(Path.Combine(queueName, "q", "*.x"), 500).ToList();
94+
foreach (var file in files.Where(f => f.Modified < DateTime.Now.Subtract(maxLockAge.Value)))
9495
storage.ReleaseFile(file);
9596
}
9697

0 commit comments

Comments
 (0)