From 14fae4b2468b558fcebaf92adf36c557bd1957fd Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Fri, 1 Aug 2025 22:06:45 -0500 Subject: [PATCH] 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. --- FreeTubeSyncer/REST/Syncer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FreeTubeSyncer/REST/Syncer.cs b/FreeTubeSyncer/REST/Syncer.cs index b92c4ed..0726331 100644 --- a/FreeTubeSyncer/REST/Syncer.cs +++ b/FreeTubeSyncer/REST/Syncer.cs @@ -218,8 +218,9 @@ public class Syncer : 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;