reducing memory usage in job runner
This commit is contained in:
parent
c6cc09b422
commit
5ff8d3409b
@ -8,7 +8,7 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
|
|||||||
{
|
{
|
||||||
protected readonly ILogger<SouthernWaterApiJobRunner> _logger = logger;
|
protected readonly ILogger<SouthernWaterApiJobRunner> _logger = logger;
|
||||||
|
|
||||||
public async Task<SouthernWaterApiJob> LoadSpills(int? pageLimit = null)
|
public async Task LoadSpills(int? pageLimit = null)
|
||||||
{
|
{
|
||||||
var interval = Static.Interval;
|
var interval = Static.Interval;
|
||||||
var job = new SouthernWaterApiJob
|
var job = new SouthernWaterApiJob
|
||||||
@ -39,7 +39,7 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
|
|||||||
page.items.ForEach(s => s.JobId = job._id);
|
page.items.ForEach(s => s.JobId = job._id);
|
||||||
|
|
||||||
job.TotalItems = page.totalItems;
|
job.TotalItems = page.totalItems;
|
||||||
job.Spills.AddRange(page.items);
|
// job.Spills.AddRange(page.items);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PageLoaded(job, page);
|
await PageLoaded(job, page);
|
||||||
@ -62,8 +62,6 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
|
|||||||
{
|
{
|
||||||
_logger.LogError(e, "Exception while running job finished callback");
|
_logger.LogError(e, "Exception while running job finished callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
return job;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Task JobCreated(SouthernWaterApiJob job)
|
protected virtual Task JobCreated(SouthernWaterApiJob job)
|
||||||
|
Loading…
Reference in New Issue
Block a user