Skip to content

Commit

Permalink
Added GetStatus-method to ExistingEffects
Browse files Browse the repository at this point in the history
  • Loading branch information
stidsborg committed Aug 10, 2024
1 parent a5f90ef commit 9f3a45f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@ protected async Task EffectsAreUpdatedAfterRefresh(Task<IFunctionStore> storeTas

await secondControlPanel.Refresh();
await secondControlPanel.Effects.GetValue<string>("Id").ShouldBeAsync("SomeResult");
await secondControlPanel.Effects.GetStatus("Id").ShouldBeAsync(WorkStatus.Completed);

unhandledExceptionCatcher.ShouldNotHaveExceptions();
}
Expand Down
8 changes: 7 additions & 1 deletion Core/Cleipnir.ResilientFunctions/Domain/ExistingEffects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ public Task<IEnumerable<EffectId>> AllIds
return storedEffect.Result == null
? default
: serializer.DeserializeEffectResult<TResult>(storedEffects[effectId].Result!);
}
}

public async Task<WorkStatus> GetStatus(EffectId effectId)
{
var storedEffects = await GetStoredEffects();
return storedEffects[effectId].WorkStatus;
}

public async Task Remove(string effectId)
{
Expand Down

0 comments on commit 9f3a45f

Please sign in to comment.