Commit e0b79f0c authored by David Morley's avatar David Morley

allow single pull anytime

parent 33a19ac2
Pipeline #826 passed with stage
in 4 minutes and 16 seconds
......@@ -22,10 +22,6 @@ use Longman\IPTools\Ip;
use Poduptime\PodStatus;
use RedBeanPHP\R;
if (getMeta('pods_updating')) {
die('already running');
};
if (!is_connected()) {
die('no internet');
}
......@@ -62,11 +58,19 @@ try {
} elseif (is_cli() && (isset($argv) && in_array('Check_System_Deleted', $argv, true))) {
$sql .= ' WHERE status = ? ORDER BY id';
$pods = R::getAll($sql, [PodStatus::SYSTEM_DELETED]);
updateMeta('pods_updating', true);
if (getMeta('pods_updating')) {
die('already running');
} else {
updateMeta('pods_updating', true);
}
} elseif (is_cli()) {
$sql .= ' WHERE status < ? ORDER BY id';
$pods = R::getAll($sql, [PodStatus::PAUSED]);
updateMeta('pods_updating', true);
if (getMeta('pods_updating')) {
die('already running');
} else {
updateMeta('pods_updating', true);
}
}
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . sprintf($e->getMessage()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment