mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-22 14:13:01 +02:00
Reload Jobs loaded in context
This commit is contained in:
parent
0f6c060026
commit
694b88d200
@ -5,6 +5,7 @@ using API.Schema.NotificationConnectors;
|
|||||||
using log4net;
|
using log4net;
|
||||||
using log4net.Config;
|
using log4net.Config;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||||
|
|
||||||
namespace API;
|
namespace API;
|
||||||
|
|
||||||
@ -119,6 +120,8 @@ public static class Tranga
|
|||||||
Log.Info("JobStarter Thread running.");
|
Log.Info("JobStarter Thread running.");
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
foreach (EntityEntry entityEntry in context.ChangeTracker.Entries().ToArray())
|
||||||
|
entityEntry.Reload();
|
||||||
//Update finished Jobs to new states
|
//Update finished Jobs to new states
|
||||||
List<Job> completedJobs = context.Jobs.Where(j => j.state == JobState.Completed).ToList();
|
List<Job> completedJobs = context.Jobs.Where(j => j.state == JobState.Completed).ToList();
|
||||||
foreach (Job completedJob in completedJobs)
|
foreach (Job completedJob in completedJobs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user