save progress
This commit is contained in:
@@ -94,6 +94,17 @@ internal sealed class InMemoryRunRepository : IRunRepository
|
||||
query = query.Where(run => run.CreatedAt > createdAfter);
|
||||
}
|
||||
|
||||
if (options.Cursor is { } cursor)
|
||||
{
|
||||
query = options.SortAscending
|
||||
? query.Where(run => run.CreatedAt > cursor.CreatedAt ||
|
||||
(run.CreatedAt == cursor.CreatedAt &&
|
||||
string.Compare(run.Id, cursor.RunId, StringComparison.Ordinal) > 0))
|
||||
: query.Where(run => run.CreatedAt < cursor.CreatedAt ||
|
||||
(run.CreatedAt == cursor.CreatedAt &&
|
||||
string.Compare(run.Id, cursor.RunId, StringComparison.Ordinal) < 0));
|
||||
}
|
||||
|
||||
query = options.SortAscending
|
||||
? query.OrderBy(run => run.CreatedAt).ThenBy(run => run.Id, StringComparer.Ordinal)
|
||||
: query.OrderByDescending(run => run.CreatedAt).ThenByDescending(run => run.Id, StringComparer.Ordinal);
|
||||
|
||||
@@ -12,6 +12,7 @@ using StellaOps.Scheduler.ImpactIndex;
|
||||
using StellaOps.Scheduler.Models;
|
||||
using StellaOps.Scheduler.Storage.Postgres.Repositories;
|
||||
using StellaOps.Scheduler.WebService.Auth;
|
||||
using StellaOps.Scheduler.WebService.Schedules;
|
||||
|
||||
namespace StellaOps.Scheduler.WebService.Runs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user