Changeset 8957 for trunk/sources/HeuristicLab.Clients.Hive.Slave
- Timestamp:
- 11/28/12 09:57:35 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/SlaveShutdown (added) merged: 8944-8945,8949,8951,8953-8954
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r7259 r8957 25 25 using System.Threading; 26 26 using System.Threading.Tasks; 27 using HeuristicLab.Clients.Hive.SlaveCore.Properties;28 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;29 27 using HeuristicLab.Common; 30 28 using HeuristicLab.Core; … … 54 52 55 53 public Core() { 56 var log = new ThreadSafeLog(S ettings.Default.MaxLogCount);54 var log = new ThreadSafeLog(SlaveCore.Properties.Settings.Default.MaxLogCount); 57 55 this.pluginManager = new PluginManager(WcfService.Instance, log); 58 56 this.taskManager = new TaskManager(pluginManager, log); … … 76 74 slaveComm = new ServiceHost(typeof(SlaveCommunicationService)); 77 75 slaveComm.Open(); 78 76 79 77 // delete all left over task directories 80 78 pluginManager.CleanPluginTemp(); … … 96 94 } 97 95 ShutdownCore(); 98 } finally { 96 } 97 finally { 99 98 DeregisterServiceEvents(); 100 99 waitShutdownSem.Release(); … … 185 184 HeartbeatManager.Interval = TimeSpan.FromSeconds(interval); 186 185 } 186 break; 187 case MessageContainer.MessageType.ShutdownComputer: 188 ShutdownComputer(); 187 189 break; 188 190 } … … 450 452 } 451 453 454 private void ShutdownComputer() { 455 var t = TS.Task.Factory.StartNew(new Action(Shutdown)); 456 t.ContinueWith(c => { 457 try { 458 Process.Start(SlaveCore.Properties.Settings.Default.ShutdownCommand); 459 } 460 catch (Exception ex) { 461 if (ServiceEventLog != null) { 462 EventLogManager.LogException(ex); 463 } else 464 throw ex; 465 } 466 }); 467 } 468 452 469 /// <summary> 453 470 /// complete shutdown, should be called before the the application is exited -
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.Designer.cs
r7777 r8957 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 } -
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.settings
r7777 r8957 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> -
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/app.config
r7777 r8957 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.