Updated Syncer

Removed un-nesscary Close() as using should automatically close, and
dispose of the file handler.
Added a 100ms wait after we finish writing the file, before we unlock
the watcher, so we don't generate un-nesscary events.
This commit is contained in:
Mario Steele 2025-08-01 22:06:45 -05:00
parent 4c400c03b8
commit 14fae4b246

View file

@ -218,8 +218,9 @@ public class Syncer<T> : ISyncer where T : class, IDataModel, new()
foreach (var line in json)
fh.Write(Encoding.UTF8.GetBytes(line + "\n"));
fh.Flush();
fh.Close();
}
Task.Delay(100).Wait();
_watcher.Locked = false;
Log.Information("Updated {DbName}, completed in {TimeSpan}", _dbName, DateTime.Now - start);
_isDirty = false;