- Timestamp:
- 12/06/11 14:30:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveCmdsWithKill.cs
r6983 r7135 126 126 127 127 private void StartService() { 128 TimeSpan timeout = TimeSpan.FromMilliseconds(5000);129 130 128 ServiceController service = new ServiceController(serviceName); 131 129 try { 132 130 if (service.Status == ServiceControllerStatus.Running) { 133 131 service.Stop(); 134 service.WaitForStatus(ServiceControllerStatus.Stopped, timeout);132 service.WaitForStatus(ServiceControllerStatus.Stopped, Settings.Default.ServiceStartStopTimeout); 135 133 } 136 134 137 135 service.Start(); 138 service.WaitForStatus(ServiceControllerStatus.Running, timeout);136 service.WaitForStatus(ServiceControllerStatus.Running, Settings.Default.ServiceStartStopTimeout); 139 137 } 140 138 catch (InvalidOperationException ex) { … … 147 145 148 146 private void StopService() { 149 TimeSpan timeout = TimeSpan.FromMilliseconds(7000);150 151 147 ServiceController service = new ServiceController(serviceName); 152 148 try { 153 149 if (service.Status == ServiceControllerStatus.Running) { 154 150 service.Stop(); 155 service.WaitForStatus(ServiceControllerStatus.Stopped, timeout);151 service.WaitForStatus(ServiceControllerStatus.Stopped, Settings.Default.ServiceStartStopTimeout); 156 152 } 157 153 } 158 154 catch (InvalidOperationException ex) { 159 MessageBox.Show("Error st arting service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString());155 MessageBox.Show("Error stopping service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString()); 160 156 } 161 157 catch (Exception ex) { 162 MessageBox.Show("Error st arting service, exception is: " + Environment.NewLine + ex.ToString());158 MessageBox.Show("Error stopping service, exception is: " + Environment.NewLine + ex.ToString()); 163 159 } 164 160 }
Note: See TracChangeset
for help on using the changeset viewer.