install output
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
root
2024-11-27 15:57:39 +01:00
parent 20e084afe6
commit 3f6c3ae015
2 changed files with 11 additions and 36 deletions

View File

@@ -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;

View File

@@ -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";
} }
/* /*