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:
parent
4c400c03b8
commit
14fae4b246
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue