diff --git a/IOB-MAN/IOBManPanel.cs b/IOB-MAN/IOBManPanel.cs index 5ad1389c..6fbaabd6 100644 --- a/IOB-MAN/IOBManPanel.cs +++ b/IOB-MAN/IOBManPanel.cs @@ -213,8 +213,7 @@ namespace IOB_MAN { forceKillByName(item.Value.ExeName); } - //closeAllChild(true); - Thread.Sleep(250); + Thread.Sleep(100); // avvio i child foreach (var item in IobList) { @@ -1551,6 +1550,7 @@ namespace IOB_MAN /// posizione (opzionale) in lista private void startChildProc(string tgtName, string codIob, int indice = -1) { + Stopwatch sw = Stopwatch.StartNew(); ProcessStartInfo psi = null; // da testare x aprire chiudere risorsa... string TargetExe = utils.CRS("targetExe"); @@ -1579,9 +1579,13 @@ namespace IOB_MAN Process p = Process.Start(psi); // accodo nuovo IOB... - iobAdapt newIob = new iobAdapt(); DateTime adesso = DateTime.Now; - newIob.redisMan = new RedisIobCache("", codIob); + iobAdapt newIob = new iobAdapt("", codIob); + utils.lgInfo($"startChildProc Step 01 | {codIob} | {sw.ElapsedMilliseconds}ms"); +#if false + newIob.redisMan = new RedisIobCache("", codIob); +#endif + utils.lgInfo($"startChildProc Step 02 | {codIob} | {sw.ElapsedMilliseconds}ms"); newIob.CodIOB = codIob; newIob.TgtName = tgtName; //newIob.ExeName = p.ProcessName; @@ -1590,6 +1594,7 @@ namespace IOB_MAN newIob.startTime = adesso; newIob.pID = p.Id; newIob.isRunning = true; + utils.lgInfo($"startChildProc Step 03 | {codIob} | {sw.ElapsedMilliseconds}ms"); // aggiungo a datasource, se indice -1 aggiungendo e basta, altrimenti alla posizione richiesta... if (indice == -1) { @@ -1599,7 +1604,8 @@ namespace IOB_MAN { ElencoIOB.Insert(indice, newIob); } - utils.lgInfo($"Avviato child process per {codIob} | pid: {p.Id}"); + sw.Stop(); + utils.lgInfo($"Avviato child process per {codIob} | pid: {p.Id} | {sw.ElapsedMilliseconds}ms"); } catch (Exception exc) { diff --git a/IOB-MAN/RedisMan.cs b/IOB-MAN/RedisMan.cs index 47945010..7f299fb3 100644 --- a/IOB-MAN/RedisMan.cs +++ b/IOB-MAN/RedisMan.cs @@ -218,7 +218,7 @@ namespace IOB_MAN /// /// Oggetto statico connessione redis /// - public ConnectionMultiplexer connRedis + public static ConnectionMultiplexer connRedis { get { @@ -229,7 +229,7 @@ namespace IOB_MAN /// /// Oggetto statico connessione redis /// - public ConnectionMultiplexer connRedisAdmin + public static ConnectionMultiplexer connRedisAdmin { get { @@ -1125,7 +1125,7 @@ namespace IOB_MAN /// /// Connessione lazy a redis... /// - private Lazy lazyConnection = new Lazy(() => + private static Lazy lazyConnection = new Lazy(() => { string RedisConn = utils.CRS("RedisConn"); if (string.IsNullOrEmpty(RedisConn)) @@ -1139,7 +1139,7 @@ namespace IOB_MAN /// /// Connessione lazy a redis... /// - private Lazy lazyConnectionAdmin = new Lazy(() => + private static Lazy lazyConnectionAdmin = new Lazy(() => { string RedisConnAdmin = utils.CRS("RedisConnAdmin"); if (string.IsNullOrEmpty(RedisConnAdmin)) diff --git a/IOB-MAN/iobAdapt.cs b/IOB-MAN/iobAdapt.cs index d9b7552e..7419d260 100644 --- a/IOB-MAN/iobAdapt.cs +++ b/IOB-MAN/iobAdapt.cs @@ -8,6 +8,21 @@ namespace IOB_MAN // public class iobAdapt { + /// + /// Costruttore base senza init speciali + /// + public iobAdapt() { } + + /// + /// Costruttore con init redis + /// + /// + /// + public iobAdapt(string codServer, string codIob) + { + redisMan = new RedisIobCache(codServer, codIob); + } + #region Protected Fields ///