@@ -41,9 +41,8 @@ internal static class Global
4141
4242
4343
44- internal static readonly AsyncLock FileOperationAsyncLock = new AsyncLock ( ) ;
45-
46- internal static ConcurrentDictionary < string , DateTime > ConverterSavedFileDates = new ConcurrentDictionary < string , DateTime > ( ) ;
44+ internal static readonly AsyncLockQueueDictionary FileOperationLocks = new AsyncLockQueueDictionary ( ) ;
45+ //internal static readonly AsyncLock FileOperationAsyncLock = new AsyncLock();
4746 }
4847#pragma warning restore S2223
4948
@@ -303,6 +302,7 @@ internal class ConsoleWatch
303302 public static bool DoingInitialSync = false ;
304303#pragma warning restore S2223
305304
305+ private static ConcurrentDictionary < string , DateTime > ConverterSavedFileDates = new ConcurrentDictionary < string , DateTime > ( ) ;
306306 private static readonly AsyncLockQueueDictionary FileLocks = new AsyncLockQueueDictionary ( ) ;
307307
308308
@@ -396,7 +396,7 @@ public static async Task DeleteFile(string fullName, Context context)
396396 public static DateTime GetConverterSaveDate ( string fullName )
397397 {
398398 DateTime converterSaveDate ;
399- if ( ! Global . ConverterSavedFileDates . TryGetValue ( fullName , out converterSaveDate ) )
399+ if ( ! ConverterSavedFileDates . TryGetValue ( fullName , out converterSaveDate ) )
400400 {
401401 converterSaveDate = DateTime . MinValue ;
402402 }
@@ -733,7 +733,7 @@ public static async Task SaveFileModifications(string fullName, string fileData,
733733 await FileExtensions . WriteAllTextAsync ( @"\\?\" + otherFullName , fileData , context . Token ) ;
734734
735735 var now = DateTime . UtcNow ; //NB! compute now after saving the file
736- Global . ConverterSavedFileDates [ otherFullName ] = now ;
736+ ConverterSavedFileDates [ otherFullName ] = now ;
737737
738738
739739 await AddMessage ( ConsoleColor . Magenta , $ "Synchronised updates from file { fullName } ", context ) ;
@@ -752,7 +752,7 @@ public static async Task SaveFileModifications(string fullName, string fileData,
752752 await ConsoleWatch . WriteException ( ex , context ) ;
753753 }
754754
755- Global . ConverterSavedFileDates [ otherFullName ] = now ;
755+ ConverterSavedFileDates [ otherFullName ] = now ;
756756 }
757757 }
758758
@@ -780,7 +780,7 @@ public static async Task SaveFileModifications(string fullName, byte[] fileData,
780780 await FileExtensions . WriteAllBytesAsync ( @"\\?\" + otherFullName , fileData , context . Token ) ;
781781
782782 var now = DateTime . UtcNow ; //NB! compute now after saving the file
783- Global . ConverterSavedFileDates [ otherFullName ] = now ;
783+ ConverterSavedFileDates [ otherFullName ] = now ;
784784
785785
786786 await AddMessage ( ConsoleColor . Magenta , $ "Synchronised updates from file { fullName } ", context ) ;
@@ -799,7 +799,7 @@ public static async Task SaveFileModifications(string fullName, byte[] fileData,
799799 await ConsoleWatch . WriteException ( ex , context ) ;
800800 }
801801
802- Global . ConverterSavedFileDates [ otherFullName ] = now ;
802+ ConverterSavedFileDates [ otherFullName ] = now ;
803803 }
804804 }
805805
0 commit comments