@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final 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 $this->getAutoscaleReserveArgument(),
30 ));
31 }
32
33 public function execute(PhutilArgumentParser $args) {
34 $err = $this->executeStopCommand(
35 array(
36 'graceful' => $args->getArg('graceful'),
37 'force' => $args->getArg('force'),
38 ));
39
40 if ($err) {
41 return $err;
42 }
43
44 return $this->executeStartCommand(
45 array(
46 'reserve' => (float)$args->getArg('autoscale-reserve'),
47 ));
48 }
49
50}