- Timestamp:
- 11/29/12 09:57:15 (12 years ago)
- Location:
- branches/RuntimeOptimizer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RuntimeOptimizer
- Property svn:mergeinfo changed
/branches/SlaveShutdown (added) merged: 8944-8945,8949,8951,8953-8954 /trunk/sources (added) merged: 8946-8948,8950,8952,8957,8960,8962-8970
- Property svn:mergeinfo changed
-
branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r7259 r8971 22 22 using System; 23 23 using System.Diagnostics; 24 using System.IO; 25 using System.Reflection; 24 26 using System.ServiceModel; 25 27 using System.Threading; 26 28 using System.Threading.Tasks; 27 using HeuristicLab.Clients.Hive.SlaveCore.Properties;28 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;29 29 using HeuristicLab.Common; 30 30 using HeuristicLab.Core; … … 54 54 55 55 public Core() { 56 var log = new ThreadSafeLog(S ettings.Default.MaxLogCount);56 var log = new ThreadSafeLog(SlaveCore.Properties.Settings.Default.MaxLogCount); 57 57 this.pluginManager = new PluginManager(WcfService.Instance, log); 58 58 this.taskManager = new TaskManager(pluginManager, log); … … 76 76 slaveComm = new ServiceHost(typeof(SlaveCommunicationService)); 77 77 slaveComm.Open(); 78 78 79 79 // delete all left over task directories 80 80 pluginManager.CleanPluginTemp(); … … 96 96 } 97 97 ShutdownCore(); 98 } finally { 98 } 99 finally { 99 100 DeregisterServiceEvents(); 100 101 waitShutdownSem.Release(); … … 185 186 HeartbeatManager.Interval = TimeSpan.FromSeconds(interval); 186 187 } 188 break; 189 case MessageContainer.MessageType.ShutdownComputer: 190 ShutdownComputer(); 187 191 break; 188 192 } … … 450 454 } 451 455 456 private void ShutdownComputer() { 457 var t = TS.Task.Factory.StartNew(new Action(Shutdown)); 458 t.ContinueWith(c => { 459 try { 460 //we assume that *.exe means an executable in the current directory, otherwise it is a command 461 if (SlaveCore.Properties.Settings.Default.ShutdownCommand.EndsWith(".exe")) { 462 string dirName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 463 Process.Start(Path.Combine(dirName, SlaveCore.Properties.Settings.Default.ShutdownCommand)); 464 } else { 465 Process.Start(SlaveCore.Properties.Settings.Default.ShutdownCommand); 466 } 467 } 468 catch (Exception ex) { 469 if (ServiceEventLog != null) { 470 EventLogManager.LogException(ex); 471 } else 472 throw ex; 473 } 474 }); 475 } 476 452 477 /// <summary> 453 478 /// complete shutdown, should be called before the the application is exited -
branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.Designer.cs
r7777 r8971 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.5 304 // Runtime Version:4.0.30319.586 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 311 311 } 312 312 } 313 314 [global::System.Configuration.UserScopedSettingAttribute()] 315 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 316 [global::System.Configuration.DefaultSettingValueAttribute("shutdown.exe")] 317 public string ShutdownCommand { 318 get { 319 return ((string)(this["ShutdownCommand"])); 320 } 321 set { 322 this["ShutdownCommand"] = value; 323 } 324 } 313 325 } 314 326 } -
branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.settings
r7777 r8971 75 75 <Value Profile="(Default)">-1</Value> 76 76 </Setting> 77 <Setting Name="ShutdownCommand" Type="System.String" Scope="User"> 78 <Value Profile="(Default)">shutdown.exe</Value> 79 </Setting> 77 80 </Settings> 78 81 </SettingsFile> -
branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Slave/3.3/app.config
r7777 r8971 122 122 <value>-1</value> 123 123 </setting> 124 <setting name="ShutdownCommand" serializeAs="String"> 125 <value>shutdown.exe</value> 126 </setting> 124 127 </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings> 125 128 </userSettings>
Note: See TracChangeset
for help on using the changeset viewer.