|
1 | 1 | param( |
2 | | - [ValidateSet("BackupPACSDatabase","BackupMWLDatabase","RotateLogs")] |
3 | 2 | [string]$BaseInstallPath = "C:\Program Files\NHS\ManageBreastScreeningGateway", |
| 3 | + [ValidateSet("BackupPACSDatabase","BackupMWLDatabase","RotateLogs")] |
4 | 4 | [string]$Action |
5 | 5 | ) |
6 | 6 |
|
@@ -178,25 +178,27 @@ function Archive-PACS { |
178 | 178 |
|
179 | 179 | # -- Main ---------------------------------------------------------------------- |
180 | 180 |
|
| 181 | +$startStopTimeoutSeconds = 30 |
| 182 | + |
181 | 183 | switch ($Action) { |
182 | 184 |
|
183 | 185 | "RotateLogs" { |
184 | | - Stop-AllServices -Services $Services |
| 186 | + Stop-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
185 | 187 | Rotate-ServiceLogs -Services $services -LogsDir $logsDir |
186 | | - Start-AllServices -Services $Services |
| 188 | + Start-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
187 | 189 | } |
188 | 190 |
|
189 | 191 | "BackupPACSDatabase" { |
190 | | - Stop-AllServices -Services $Services |
| 192 | + Stop-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
191 | 193 | Invoke-DatabaseBackup -BaseInstallPath $BaseInstallPath -DbServiceName "PACS" |
192 | 194 | Archive-PACS -BaseInstallPath $BaseInstallPath |
193 | | - Start-AllServices -Services $Services |
| 195 | + Start-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
194 | 196 | } |
195 | 197 |
|
196 | 198 | "BackupMWLDatabase" { |
197 | | - Stop-AllServices -Services $Services |
| 199 | + Stop-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
198 | 200 | Invoke-DatabaseBackup -BaseInstallPath $BaseInstallPath -DbServiceName "MWL" |
199 | | - Start-AllServices -Services $Services |
| 201 | + Start-AllServices -Services $Services -TimeoutSeconds $startStopTimeoutSeconds |
200 | 202 | } |
201 | 203 |
|
202 | 204 | } |
|
0 commit comments