summaryrefslogtreecommitdiff
path: root/lib/spawningdaemon.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-09 12:39:31 -0800
committerBrion Vibber <brion@pobox.com>2010-02-09 14:27:33 -0800
commite856af34c3ac560a21286ca89019c2249994c080 (patch)
treeb50002624680f9a0de669a070fa46a260ac1d116 /lib/spawningdaemon.php
parent70d5f39ed66cb277e925ea71dcc24ca580110b3d (diff)
Configurable delay between queuedaemon.php spawns/respawns to help stagger out startups and subscriptions. Defaults to 1 second.
$config['queue']['spawndelay'] = 1;
Diffstat (limited to 'lib/spawningdaemon.php')
-rw-r--r--lib/spawningdaemon.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/spawningdaemon.php b/lib/spawningdaemon.php
index b1961d688..862cbb4fa 100644
--- a/lib/spawningdaemon.php
+++ b/lib/spawningdaemon.php
@@ -83,6 +83,7 @@ abstract class SpawningDaemon extends Daemon
$this->log(LOG_INFO, "Spawned thread $i as pid $pid");
$children[$i] = $pid;
}
+ sleep(common_config('queue', 'spawndelay'));
}
$this->log(LOG_INFO, "Waiting for children to complete.");
@@ -111,6 +112,7 @@ abstract class SpawningDaemon extends Daemon
$this->log(LOG_INFO, "Respawned thread $i as pid $pid");
$children[$i] = $pid;
}
+ sleep(common_config('queue', 'spawndelay'));
} else {
$this->log(LOG_INFO, "Thread $i pid $pid exited with status $exitCode; closing out thread.");
}