mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(archival): ✨ archive lists in random order
This commit is contained in:
parent
6dd066f82d
commit
7f37cb15df
1 changed files with 5 additions and 2 deletions
|
|
@ -1,4 +1,6 @@
|
|||
using System.Threading;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Archival.Infrastructure.Scheduling;
|
||||
using FilterLists.SharedKernel.Apis.Clients;
|
||||
|
|
@ -24,7 +26,8 @@ public Handler(IDirectoryApi directory)
|
|||
public async Task<Unit> Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
var lists = await _directory.GetListsAsync(cancellationToken);
|
||||
foreach (var list in lists)
|
||||
var r = new Random();
|
||||
foreach (var list in lists.OrderBy(_ => r.Next()))
|
||||
{
|
||||
new ArchiveList.Command(list.Id).EnqueueBackgroundJob();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue