From 218eef1ed03f7c879af71e197da833474f2d5b66 Mon Sep 17 00:00:00 2001 From: Joshua Hegedus Date: Wed, 31 Dec 2025 23:16:46 +0100 Subject: [PATCH] added interface for JobStateStore and JobProgress class --- idou.Core/Engine/IJobStateStore.cs | 13 +++++++++++++ idou.Core/Engine/JobProgress.cs | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 idou.Core/Engine/IJobStateStore.cs create mode 100644 idou.Core/Engine/JobProgress.cs diff --git a/idou.Core/Engine/IJobStateStore.cs b/idou.Core/Engine/IJobStateStore.cs new file mode 100644 index 0000000..2769695 --- /dev/null +++ b/idou.Core/Engine/IJobStateStore.cs @@ -0,0 +1,13 @@ +using idou.Core.Domain.Enums; + +namespace idou.Core.Engine; + +public interface IJobStateStore +{ + JobStatus GetStatus(string jobId); + JobProgress GetProgress(string jobId); + void SetStatus(string jobId, JobStatus status); + void UpdateProgress(string jobId, JobProgress progress); + void AppendLog(string jobId, string message); + IReadOnlyList ReadLogs(string jobId, int tail); +} \ No newline at end of file diff --git a/idou.Core/Engine/JobProgress.cs b/idou.Core/Engine/JobProgress.cs new file mode 100644 index 0000000..4cbf51e --- /dev/null +++ b/idou.Core/Engine/JobProgress.cs @@ -0,0 +1,13 @@ +using idou.Core.Domain; + +namespace idou.Core.Engine; + +public class JobProgress +{ + public long ProcessedChanges { get; } + public long AppliedChanges { get; } + public long FailedChanges { get; } + public DateTimeOffset? LastSuccessfulApplyAt { get; } + public Checkpoint? LastCheckpoint { get; } + public string? LastErrorMessage { get; } +} \ No newline at end of file