Add temp logging, Move Http to be last in the order as its currently blocking, a few exceptions blocked out onLoad methods

This commit is contained in:
CWX
2025-01-11 21:43:43 +00:00
parent 0d158d2285
commit e2dbb7a092
7 changed files with 30 additions and 18 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ public class ModCallbacks : OnLoad
// if (ProgramStatics.MODS) {
// await this.postSptModLoader.load();
// } TODO: needs to be implemented
throw new NotImplementedException();
return;
}
public string GetRoute()
+1 -3
View File
@@ -26,12 +26,10 @@ public class SaveCallbacks : OnLoad, OnUpdate
_backupService = backupService;
}
public Task OnLoad()
public async Task OnLoad()
{
_backupService.InitAsync();
_saveServer.Load();
return Task.CompletedTask;
}
public async Task<bool> OnUpdate(long SecondsSinceLastRun)
+1 -1
View File
@@ -187,6 +187,6 @@ public class GameController
public void Load()
{
throw new NotImplementedException();
return; // TODO: actually implement
}
}
+1 -1
View File
@@ -10,6 +10,6 @@ public class PresetController
/// </summary>
public void Initialize()
{
throw new NotImplementedException();
return; // TODO: actually implement
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ public class TraderController
/// </summary>
public void Load()
{
throw new NotImplementedException();
return; // TODO: actually implement
}
/// <summary>
+8 -8
View File
@@ -5,12 +5,12 @@ public static class OnLoadOrder
public const int Database = 0;
public const int PostDBModLoader = 1;
public const int HandbookCallbacks = 2;
public const int HttpCallbacks = 3;
public const int PresetCallbacks = 4;
public const int SaveCallbacks = 5;
public const int TraderCallbacks = 6;
public const int RagfairPriceService = 7;
public const int RagfairCallbacks = 8;
public const int ModCallbacks = 9;
public const int GameCallbacks = 10;
public const int PresetCallbacks = 3;
public const int SaveCallbacks = 4;
public const int TraderCallbacks = 5;
public const int RagfairPriceService = 6;
public const int RagfairCallbacks = 7;
public const int ModCallbacks = 8;
public const int GameCallbacks = 9;
public const int HttpCallbacks = 10;
}
+17 -3
View File
@@ -79,9 +79,23 @@ public class App
_logger.Debug("Commit: ${ProgramStatics.COMMIT}");
}
*/
foreach (var onLoad in _onLoad) await onLoad.OnLoad();
foreach (var onLoad in _onLoad)
{
Console.WriteLine($"Start Onload: {onLoad.GetRoute()}");
await onLoad.OnLoad();
Console.WriteLine($"finish Onload: {onLoad.GetRoute()}");
}
var timer = new Timer(_ => { update(_onUpdate); }, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(5000));
var timer = new Timer(_ =>
{
Console.WriteLine($"Start OnUpdate");
update(_onUpdate);
Console.WriteLine($"Finish OnUpdate");
},
null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(5000));
}
protected async Task update(IEnumerable<OnUpdate> onUpdateComponents)
@@ -124,4 +138,4 @@ public class App
_logger.Error(_localisationService.GetText("scheduled_event_failed_to_run", updateable.GetRoute()));
_logger.Error(err.ToString());
}
}
}