Skip to content

Commit e4f49f0

Browse files
author
epriestley
committed
When available, use async_signals in Phabricator
Summary: Ref T9640. See D17200 for the analogous change in libphutil. Test Plan: See D17200. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9640 Differential Revision: https://secure.phabricator.com/D17201
1 parent 7ccc4ce commit e4f49f0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/daemon/launch_daemon.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
// script, except it loads the Phabricator environment and adds some Phabricator
66
// specific flags.
77

8-
declare(ticks = 1);
8+
if (function_exists('pcntl_async_signals')) {
9+
pcntl_async_signals(true);
10+
} else {
11+
declare(ticks = 1);
12+
}
913

1014
$root = dirname(dirname(dirname(__FILE__)));
1115
require_once $root.'/scripts/__init_script__.php';

scripts/ssh/ssh-connect.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
// In some cases, Subversion sends us SIGTERM. If we don't catch the signal and
88
// react to it, we won't run object destructors by default and thus won't clean
99
// up temporary files. Declare ticks so we can install a signal handler.
10-
declare(ticks=1);
10+
if (function_exists('pcntl_async_signals')) {
11+
pcntl_async_signals(true);
12+
} else {
13+
declare(ticks = 1);
14+
}
1115

1216
$root = dirname(dirname(dirname(__FILE__)));
1317
require_once $root.'/scripts/__init_script__.php';

0 commit comments

Comments
 (0)