Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php
12256 views
1
<?php
2
3
final class PhabricatorDaemonManagementRestartWorkflow
4
extends PhabricatorDaemonManagementWorkflow {
5
6
protected function didConstruct() {
7
$this
8
->setName('restart')
9
->setSynopsis(
10
pht(
11
'Stop daemon processes on this host, then start the standard '.
12
'daemon loadout.'))
13
->setArguments(
14
array(
15
array(
16
'name' => 'graceful',
17
'param' => 'seconds',
18
'help' => pht(
19
'Grace period for daemons to attempt a clean shutdown, in '.
20
'seconds. Defaults to __15__ seconds.'),
21
'default' => 15,
22
),
23
array(
24
'name' => 'force',
25
'help' => pht(
26
'Stop all daemon processes on this host, even if they belong '.
27
'to another instance.'),
28
),
29
array(
30
'name' => 'gently',
31
'help' => pht('Deprecated. Has no effect.'),
32
),
33
$this->getAutoscaleReserveArgument(),
34
));
35
}
36
37
public function execute(PhutilArgumentParser $args) {
38
$err = $this->executeStopCommand(
39
array(
40
'graceful' => $args->getArg('graceful'),
41
'force' => $args->getArg('force'),
42
));
43
44
if ($err) {
45
return $err;
46
}
47
48
return $this->executeStartCommand(
49
array(
50
'reserve' => (float)$args->getArg('autoscale-reserve'),
51
));
52
}
53
54
}
55
56