Renamed Call Start and Stop to Enable and Disable

This commit is contained in:
2025-08-31 02:51:49 +02:00
parent 2187a59936
commit 92bf48d06a
4 changed files with 16 additions and 16 deletions

View File

@@ -25,13 +25,13 @@ public class RunOnceCall : ICall
IndexAsync();
}
public void Start()
public void Enable()
{
IndexAsync();
IsEnabled = true;
}
public void Stop()
public void Disable()
{
IsEnabled = false;
}
@@ -128,13 +128,13 @@ public class IntervalCall : ICall
};
}
public void Start()
public void Enable()
{
Timer.Start();
IsEnabled = true;
}
public void Stop()
public void Disable()
{
Scriptable.Stop();
Timer.Stop();
@@ -218,10 +218,10 @@ public class ScheduleCall : ICall
}
};
CreateJob().Wait();
Start();
Enable();
}
public void Start()
public void Enable()
{
if (!IsEnabled)
{
@@ -230,7 +230,7 @@ public class ScheduleCall : ICall
}
}
public void Stop()
public void Disable()
{
Scheduler.PauseAll();
IsEnabled = false;
@@ -317,7 +317,7 @@ public class FileUpdateCall : ICall
_watcher.EnableRaisingEvents = true;
}
public void Start()
public void Enable()
{
if (!IsEnabled)
{
@@ -327,7 +327,7 @@ public class FileUpdateCall : ICall
}
}
public void Stop()
public void Disable()
{
if (IsEnabled)
{

View File

@@ -67,7 +67,7 @@ public class CallsController : ControllerBase
_logger.LogInformation("Starting calls in worker {workerName}.", [workerName]);
foreach (ICall call in worker.Calls)
{
call.Start();
call.Enable();
}
_logger.LogInformation("Finished starting calls in worker {workerName}.", [workerName]);
}
@@ -81,7 +81,7 @@ public class CallsController : ControllerBase
return new CallEnableResult { Success = false };
}
_logger.LogInformation("Starting call {callName} in worker {workerName}.", [callName, workerName]);
call.Start();
call.Enable();
}
return new CallEnableResult { Success = true };
}
@@ -100,7 +100,7 @@ public class CallsController : ControllerBase
_logger.LogInformation("Stopping calls in worker {name}.", [workerName]);
foreach (ICall call in worker.Calls)
{
call.Stop();
call.Disable();
}
_logger.LogInformation("Stopped calls in worker {name}.", [workerName]);
} else
@@ -113,7 +113,7 @@ public class CallsController : ControllerBase
return new CallDisableResult { Success = false };
}
_logger.LogInformation("Starting call {callName} in worker {workerName}.", [callName, workerName]);
call.Stop();
call.Disable();
}
return new CallDisableResult { Success = true };
}

View File

@@ -36,7 +36,7 @@ public class ConfigController : ControllerBase
Worker worker = workerKVPair.Value;
foreach (ICall call in worker.Calls)
{
call.Stop();
call.Disable();
call.Dispose();
}
worker.Calls.Clear();

View File

@@ -16,8 +16,8 @@ public class CallConfig
public interface ICall
{
public HealthCheckResult HealthCheck();
public void Start();
public void Stop();
public void Enable();
public void Disable();
public void Dispose();
public string Name { get; set; }
public bool IsEnabled { get; set; }