|
|
|
@ -49,11 +49,9 @@ namespace Ombi.Schedule.Jobs.SickRage
|
|
|
|
|
var strat = _ctx.Database.CreateExecutionStrategy();
|
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
|
{
|
|
|
|
|
using (var tran = await _ctx.Database.BeginTransactionAsync())
|
|
|
|
|
{
|
|
|
|
|
using var tran = await _ctx.Database.BeginTransactionAsync();
|
|
|
|
|
await _ctx.Database.ExecuteSqlRawAsync("DELETE FROM SickRageCache");
|
|
|
|
|
tran.Commit();
|
|
|
|
|
}
|
|
|
|
|
await tran.CommitAsync();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var entites = ids.Select(id => new SickRageCache { TvDbId = id }).ToList();
|
|
|
|
@ -84,12 +82,10 @@ namespace Ombi.Schedule.Jobs.SickRage
|
|
|
|
|
strat = _ctx.Database.CreateExecutionStrategy();
|
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
|
{
|
|
|
|
|
using (var tran = await _ctx.Database.BeginTransactionAsync())
|
|
|
|
|
{
|
|
|
|
|
using var tran = await _ctx.Database.BeginTransactionAsync();
|
|
|
|
|
await _ctx.SickRageEpisodeCache.AddRangeAsync(episodesToAdd);
|
|
|
|
|
await _ctx.SaveChangesAsync();
|
|
|
|
|
tran.Commit();
|
|
|
|
|
}
|
|
|
|
|
await tran.CommitAsync();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|