Skip to content

Commit 8603621

Browse files
committed
[BREAKING]: Removed unused serializer parameter from GetEventBatch File Storage Extensions
1 parent 872537a commit 8603621

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/Exceptionless/Extensions/FileStorageExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public static bool IncrementAttempts(this IObjectStorage storage, ObjectInfo inf
3838
throw new ArgumentException($"Path \"{info.Path}\" must contain the number of attempts.");
3939

4040
version++;
41-
string newpath = String.Join(".", parts[0], version, parts[2]);
41+
string newPath = String.Join(".", parts[0], version, parts[2]);
4242
if (parts.Length == 4)
43-
newpath += "." + parts[3];
43+
newPath += "." + parts[3];
4444

4545
string originalPath = info.Path;
46-
info.Path = newpath;
46+
info.Path = newPath;
4747

48-
return storage.RenameObject(originalPath, newpath);
48+
return storage.RenameObject(originalPath, newPath);
4949
}
5050

5151
public static int GetAttempts(this ObjectInfo info) {
@@ -94,7 +94,7 @@ public static void ReleaseStaleLocks(this IObjectStorage storage, string queueNa
9494
storage.ReleaseFile(file);
9595
}
9696

97-
public static IList<Tuple<ObjectInfo, Event>> GetEventBatch(this IObjectStorage storage, string queueName, IJsonSerializer serializer, int batchSize = 50, DateTime? maxCreatedDate = null) {
97+
public static IList<Tuple<ObjectInfo, Event>> GetEventBatch(this IObjectStorage storage, string queueName, int batchSize = 50, DateTime? maxCreatedDate = null) {
9898
var events = new List<Tuple<ObjectInfo, Event>>();
9999

100100
lock (_lockObject) {

src/Exceptionless/Queue/DefaultEventQueue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task ProcessAsync() {
5757

5858
DateTime maxCreatedDate = DateTime.Now;
5959
int batchSize = _config.SubmissionBatchSize;
60-
var batch = _storage.GetEventBatch(queueName, _serializer, batchSize, maxCreatedDate);
60+
var batch = _storage.GetEventBatch(queueName, batchSize, maxCreatedDate);
6161
while (batch.Any()) {
6262
bool deleteBatch = true;
6363

@@ -118,7 +118,7 @@ public async Task ProcessAsync() {
118118
if (!deleteBatch || IsQueueProcessingSuspended)
119119
break;
120120

121-
batch = _storage.GetEventBatch(queueName, _serializer, batchSize, maxCreatedDate);
121+
batch = _storage.GetEventBatch(queueName, batchSize, maxCreatedDate);
122122
}
123123
} catch (Exception ex) {
124124
_log.Error(typeof(DefaultEventQueue), ex, String.Concat("An error occurred processing the queue: ", ex.Message));

test/Exceptionless.Tests/Storage/FileStorageTestsBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public void CanManageQueue() {
9797
Assert.True(storage.GetQueueFiles(queueName).All(f => f.Path.EndsWith("0.json.x")));
9898
Assert.True(storage.ReleaseFile(storage.GetObjectList().FirstOrDefault()));
9999

100-
var batch = storage.GetEventBatch(queueName, serializer);
100+
var batch = storage.GetEventBatch(queueName);
101101
Assert.Equal(1, batch.Count);
102102

103103
Assert.True(storage.GetObjectList().All(f => f.Path.StartsWith(Path.Combine(queueName, "q")) && f.Path.EndsWith("1.json.x")));
104104
Assert.Single(storage.GetObjectList());
105105

106106
Assert.Empty(storage.GetQueueFiles(queueName));
107-
Assert.Empty(storage.GetEventBatch(queueName, serializer));
107+
Assert.Empty(storage.GetEventBatch(queueName));
108108

109109
Assert.False(storage.LockFile(storage.GetObjectList().FirstOrDefault()));
110110

@@ -126,7 +126,7 @@ public void CanManageQueue() {
126126
storage.ReleaseStaleLocks(queueName, TimeSpan.Zero);
127127
Assert.True(storage.GetObjectList().All(f => f.Path.StartsWith(Path.Combine(queueName, "q")) && f.Path.EndsWith("3.json")));
128128

129-
batch = storage.GetEventBatch(queueName, serializer);
129+
batch = storage.GetEventBatch(queueName);
130130
Assert.Equal(1, batch.Count);
131131
Assert.True(storage.GetObjectList().All(f => f.Path.StartsWith(Path.Combine(queueName, "q")) && f.Path.EndsWith("4.json.x")));
132132
storage.DeleteBatch(batch);
@@ -171,7 +171,7 @@ public void CanConcurrentlyManageFiles() {
171171
var working = new ConcurrentDictionary<string, object>();
172172

173173
Parallel.For(0, 50, i => {
174-
var fileBatch = storage.GetEventBatch(queueName, serializer, 2);
174+
var fileBatch = storage.GetEventBatch(queueName, 2);
175175
foreach (var f in fileBatch) {
176176
if (working.ContainsKey(f.Item1.Path))
177177
Debug.WriteLine(f.Item1.Path);

0 commit comments

Comments
 (0)