Fix AutoSave - Now Working !
This commit is contained in:
@@ -15,6 +15,8 @@ namespace PlantBox.Broker
|
||||
|
||||
public bool IsRunning { get; set; } = true;
|
||||
|
||||
private Timer _autoSaveTimer;
|
||||
|
||||
public Broker(string[] args)
|
||||
{
|
||||
Console.WriteLine("Initializing Broker...");
|
||||
@@ -34,7 +36,7 @@ namespace PlantBox.Broker
|
||||
Task.Run(() => ServerManager.Start());
|
||||
|
||||
// Auto-Save
|
||||
new Timer(OnSave, null, TimeSpan.FromMinutes(15), TimeSpan.FromMinutes(15));
|
||||
_autoSaveTimer = new Timer(OnSave, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1));
|
||||
|
||||
string input;
|
||||
do
|
||||
@@ -51,6 +53,7 @@ namespace PlantBox.Broker
|
||||
Console.WriteLine("Stopping Broker...");
|
||||
|
||||
IsRunning = false;
|
||||
_autoSaveTimer.Dispose();
|
||||
PlantBoxesManager.Save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user