Async task OnUpdate (#355)
* Make OnUpdate a task instead a void, handle OnUpdate better by running it in it's own task * Make helper transient, resolve mod loading issues
This commit is contained in:
@@ -22,15 +22,14 @@ public class InsuranceCallbacks(
|
||||
{
|
||||
private readonly InsuranceConfig _insuranceConfig = _configServer.GetConfig<InsuranceConfig>();
|
||||
|
||||
public bool OnUpdate(long timeSinceLastRun)
|
||||
public Task OnUpdate(long timeSinceLastRun)
|
||||
{
|
||||
if (timeSinceLastRun > Math.Max(_insuranceConfig.RunIntervalSeconds, 1))
|
||||
{
|
||||
_insuranceController.ProcessReturn();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user