This commit is contained in:
@@ -17,45 +17,19 @@ function ping_redis() {
|
|||||||
|
|
||||||
function check_install() { // is install in progress
|
function check_install() { // is install in progress
|
||||||
|
|
||||||
global $REDIS_HOST;
|
$arr = check_request("install");
|
||||||
|
if (!empty($arr)) return "install"; // install in progress
|
||||||
$redis = new Redis();
|
else return "";
|
||||||
$redis->connect($REDIS_HOST);
|
|
||||||
if ($redis->ping()) {
|
|
||||||
$members = $redis->sMembers("web_in"); // redis-cli -h redis-server smembers $group
|
|
||||||
|
|
||||||
$in_progress=0;
|
|
||||||
foreach ($members as $member) {
|
|
||||||
if (substr($member,0,7)=="install") {
|
|
||||||
$in_progress=$member;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $in_progress;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_deploy() { // is a deploy in progress
|
function check_deploy() { // is a deploy in progress
|
||||||
|
|
||||||
global $REDIS_HOST;
|
$arr = check_request("deployment");
|
||||||
|
if (!empty($arr)) return "deployment"; // deploy in progress
|
||||||
$redis = new Redis();
|
else return 0;
|
||||||
$redis->connect($REDIS_HOST);
|
|
||||||
if ($redis->ping()) {
|
|
||||||
$members = $redis->sMembers("web_in"); // redis-cli -h redis-server smembers $group
|
|
||||||
|
|
||||||
$in_progress=0;
|
|
||||||
foreach ($members as $member) {
|
|
||||||
if (substr($member,0,10)=="deployment") {
|
|
||||||
$in_progress=$member;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $in_progress;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_redis($group="scheduler_in", $key="") {
|
function check_redis($group="web_out", $key="") {
|
||||||
|
|
||||||
global $REDIS_HOST;
|
global $REDIS_HOST;
|
||||||
|
|
||||||
|
@@ -44,9 +44,10 @@ if ($key=check_install()) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$header_text="Installing in progress... Please wait...";
|
$header_text="Installing in progress... Please wait...";
|
||||||
$key = "install:".date("YmdHis");
|
//$key = "install:".date("YmdHis");
|
||||||
redis_set($key,$json);
|
$key = "install";
|
||||||
//$key = "install:20240816101849"; // DEBUG
|
if (set_output($key,$json)) echo "OK";
|
||||||
|
else echo "ERROR";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user