From 26b8b2c94958876df40767265b339403ded8d87d Mon Sep 17 00:00:00 2001 From: Marc Hernandez Date: Wed, 28 Sep 2022 19:41:22 -0700 Subject: [PATCH] Reprocess files that get an IOException --- scr/Script.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scr/Script.cs b/scr/Script.cs index 3f631f3..4d417ff 100644 --- a/scr/Script.cs +++ b/scr/Script.cs @@ -164,7 +164,26 @@ public static class scr if( e.Name.EndsWith(".cs") ) { - Process( e.FullPath ); + while( true ) + { + try + { + Process( e.FullPath ); + return; + } + catch( System.IO.IOException ex ) + { + + } + catch( Exception ex ) + { + log.error( $"Got ex {ex.GetType().Name} trying to process {e.FullPath}" ); + log.error( $"-> {ex.Message}" ); + return; + } + + Thread.Sleep( 100 ); + } } }