Renamed IScriptable to IScriptContainer, added Stop() function to Calls

This commit is contained in:
2025-08-31 03:02:43 +02:00
parent 92bf48d06a
commit 0647f10ca1
7 changed files with 29 additions and 8 deletions

View File

@@ -38,6 +38,11 @@ public class RunOnceCall : ICall
public void Dispose() {}
public void Stop()
{
Worker.Scriptable.Stop();
}
private async void IndexAsync()
{
try
@@ -73,7 +78,7 @@ public class RunOnceCall : ICall
public class IntervalCall : ICall
{
public System.Timers.Timer Timer;
public IScriptable Scriptable;
public IScriptContainer Scriptable;
public ILogger _logger;
public bool IsEnabled { get; set; }
public bool IsExecuting { get; set; }
@@ -145,6 +150,11 @@ public class IntervalCall : ICall
Timer.Dispose();
}
public void Stop()
{
Scriptable.Stop();
}
public HealthCheckResult HealthCheck()
{
if (!Scriptable.UpdateInfo.Successful)
@@ -241,6 +251,11 @@ public class ScheduleCall : ICall
Scheduler.DeleteJob(JobKey);
}
public void Stop()
{
Worker.Scriptable.Stop();
}
private async Task CreateJob()
{
if (CallConfig.Schedule is null)
@@ -341,6 +356,11 @@ public class FileUpdateCall : ICall
_watcher.Dispose();
}
public void Stop()
{
Worker.Scriptable.Stop();
}
private void OnFileChanged(object sender, FileSystemEventArgs e)
{
if (!IsEnabled)