Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisProvider - Remove the actual event record if we're tidying up after ourselves. #1187

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,13 @@ public async Task<string> CreateEvent(Event newEvent, CancellationToken _ = defa
await _redis.HashSetAsync($"{_prefix}.{EVENT_SET}", newEvent.Id, str);
await _redis.SortedSetAddAsync($"{_prefix}.{EVENT_SET}.{EVENTSLUG_INDEX}.{newEvent.EventName}-{newEvent.EventKey}", newEvent.Id, newEvent.EventTime.Ticks);

if (newEvent.IsProcessed)
if (newEvent.IsProcessed){
await _redis.SortedSetRemoveAsync($"{_prefix}.{EVENT_SET}.{RUNNABLE_INDEX}", newEvent.Id);

if (_removeComplete){
await _redis.SortedSetRemoveAsync($"{_prefix}.{EVENT_SET}", newEvent.Id);
}
}
else
await _redis.SortedSetAddAsync($"{_prefix}.{EVENT_SET}.{RUNNABLE_INDEX}", newEvent.Id, newEvent.EventTime.Ticks);

Expand Down Expand Up @@ -225,6 +230,9 @@ public async Task MarkEventProcessed(string id, CancellationToken cancellationTo
var str = JsonConvert.SerializeObject(evt, _serializerSettings);
await _redis.HashSetAsync($"{_prefix}.{EVENT_SET}", evt.Id, str);
await _redis.SortedSetRemoveAsync($"{_prefix}.{EVENT_SET}.{RUNNABLE_INDEX}", id);
if (_removeComplete){
await _redis.SortedSetRemoveAsync($"{_prefix}.{EVENT_SET}", id);
}
}

public async Task MarkEventUnprocessed(string id, CancellationToken cancellationToken = default)
Expand Down