static void Main(string[] args) { int DefaultSleep = 150000; foreach (string s in args) { string[] param = s.Split('='); switch (param[0].Trim().ToLower()) { case "sleep": int.TryParse(param[1], out DefaultSleep); break; } } while (true) { try { using (IridiumToMySQL irid = new IridiumToMySQL()) { irid.Run(1, 0); } } catch { } Thread.Sleep(DefaultSleep); } }
static void Main(string[] args) { ConfigFile configfile; string absolute_path = System.Reflection.Assembly.GetExecutingAssembly().Location; string aPath = string.Format(System.IO.Path.GetDirectoryName(absolute_path)); configfile = ConfigFile.getConfigFile(aPath); int sleepCant = Convert.ToInt32(configfile.getConfigValue("programsection", "sleepmiliseconds", "sleepCant")); int timeCant = Convert.ToInt32(configfile.getConfigValue("programsection", "timeMiliseconds", "timeMinutesCant")); //int DefaultSleep = 60000; /*foreach (string s in args) { string[] param = s.Split('='); switch (param[0].Trim().ToLower()) { case "sleep": int.TryParse(param[1], out DefaultSleep); break; } }*/ //Stopwatch sw = new Stopwatch(); //sw.Start(); //while (sw.Elapsed < TimeSpan.FromMilliseconds(timeCant)) //{ // try // { // using (IridiumToMySQL irid = new IridiumToMySQL()) // { // irid.Run(1, sleepCant,timeCant); // } // } // catch { } //} //sw.Stop(); try { using (IridiumToMySQL irid = new IridiumToMySQL()) { irid.Run(1, sleepCant, timeCant); } } catch { } /*while(true) { try { using (IridiumToMySQL irid = new IridiumToMySQL()) { irid.Run(1, 0); } } catch { } Thread.Sleep(DefaultSleep); }*/ }
public void Run() { while (RUNFOREVER) { using (IridiumToMySQL irid = new IridiumToMySQL()) { try { ConfigFile configfile; configfile = ConfigFile.getConfigFile(); int sleepCant = Convert.ToInt32(configfile.getConfigValue("programsection", "sleepmiliseconds", "sleepCant")); int timeCant = Convert.ToInt32(configfile.getConfigValue("programsection", "timeMiliseconds", "timeMinutesCant")); irid.Run(1, sleepCant, timeCant); } catch (Exception ex) { irid.log.writeToLogFile(net.Tesacom.GeneralUtilities.Logger.LogType.LOG_CRITICAL, "IridiumExtreme To VDMS", "error general en servicio: {0}", ex.Message); } finally { irid.log.Flush(); } } Thread.Sleep(DELAYBETWEENRUNS); } }
public void Run() { while (RUNFOREVER) { using (IridiumToMySQL irid = new IridiumToMySQL()) { try { irid.Run(1, 0); } catch (Exception ex) { irid.log.writeToLogFile(net.Tesacom.GeneralUtilities.Logger.LogType.LOG_CRITICAL, "IridiumExtreme To VDMS", "error general en servicio: {0}", ex.Message); } finally { irid.log.Flush(); } } Thread.Sleep(DELAYBETWEENRUNS); } }