mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
try capture snapshots every minute with max of once per list per day
This commit is contained in:
parent
a5a1ee93a3
commit
72a1368b7f
3 changed files with 8 additions and 4 deletions
4
cron.txt
4
cron.txt
|
|
@ -1,2 +1,2 @@
|
|||
# FilterLists - Capture Snapshots Hourly (skips if previous still running)
|
||||
0 * * * * /usr/bin/flock -n /tmp/filterlistsagent.lockfile /var/www/filterlists/FilterLists.Agent > /dev/null 2>&1
|
||||
# FilterLists - Try Capture Snapshots Every Minute (skips if previous still running)
|
||||
*/1 * * * * /usr/bin/flock -n /tmp/filterlistsagent.lockfile /var/www/filterlists/FilterLists.Agent > /dev/null 2>&1
|
||||
|
|
@ -21,7 +21,6 @@ public static int Main(string[] args)
|
|||
InstantiateTelemetryClient();
|
||||
InstantiateServiceProvider();
|
||||
|
||||
//TODO: capture batchSize from args
|
||||
const int batchSize = 1;
|
||||
CaptureSnapshots(batchSize);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
|
|
@ -39,6 +40,10 @@ private async Task<IEnumerable<FilterListViewUrlDto>> GetLeastRecentlyCapturedLi
|
|||
.Select(y => y.CreatedDateUtc)
|
||||
.OrderByDescending(y => y)
|
||||
.FirstOrDefault())
|
||||
.Where(x => x.Snapshots
|
||||
.Select(y => y.CreatedDateUtc)
|
||||
.OrderByDescending(y => y)
|
||||
.FirstOrDefault() < DateTime.UtcNow.AddDays(-1))
|
||||
.Take(batchSize)
|
||||
.AsNoTracking()
|
||||
.ProjectTo<FilterListViewUrlDto>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue