1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-08 03:54:20 +01:00

Modify ykval-queue daemon.

- don't run ykval-queue for single node configurations.
This commit is contained in:
Jean Paul Galea 2015-08-18 12:09:27 +02:00
parent 54dfc6edb6
commit a0e3715dbb

View File

@ -34,16 +34,20 @@ require_once 'ykval-synclib.php';
require_once 'ykval-config.php';
require_once 'ykval-log.php';
// FIXME
// if sync pool is empty && db queue is empty:
// exit
// FIXME
// don't die if db connection goes away
// (e.g. during mysql restart or upgrade).
$sl = new SyncLib('ykval-queue:synclib');
if ($sl->getNumberOfServers() === 0 && $sl->getQueueLength() === 0)
{
$sl->log(LOG_NOTICE, 'server sync pool is empty and sync queue is also empty.');
$sl->log(LOG_NOTICE, 'configuration looks like a single node setup.');
$sl->log(LOG_NOTICE, 'ykval-queue daemon terminating.');
exit(0);
}
# Loop forever and resync
do {
$sl->reSync($baseParams['__YKVAL_SYNC_OLD_LIMIT__'],