check_init - check init response
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -31,7 +31,7 @@ function check_redis($group="scheduler_in") {
|
|||||||
// TODO json error
|
// TODO json error
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $data;
|
return array("$member" => $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,6 +80,8 @@ function redis_set($key, $value) {
|
|||||||
|
|
||||||
function redis_remove($key) {
|
function redis_remove($key) {
|
||||||
|
|
||||||
|
global $REDIS_HOST;
|
||||||
|
|
||||||
$redis = new Redis();
|
$redis = new Redis();
|
||||||
$redis->connect($REDIS_HOST);
|
$redis->connect($REDIS_HOST);
|
||||||
// $redis->auth('password');
|
// $redis->auth('password');
|
||||||
|
@@ -62,9 +62,12 @@ function check_init() {
|
|||||||
$("#previous").html('Previous install has found...');
|
$("#previous").html('Previous install has found...');
|
||||||
setTimeout(redirectToManage, 3000);
|
setTimeout(redirectToManage, 3000);
|
||||||
}
|
}
|
||||||
else {
|
else if (data=='WAIT') {
|
||||||
setTimeout(check_init, 1000);
|
setTimeout(check_init, 1000);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// UNEXPECTED ERROR
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
scan.php
12
scan.php
@@ -22,10 +22,14 @@ switch ($_GET["op"]) {
|
|||||||
echo "OK"; // TODO?
|
echo "OK"; // TODO?
|
||||||
break;
|
break;
|
||||||
case "check_init":
|
case "check_init":
|
||||||
echo "NEW";exit;// TEMP-TEST
|
$arr = check_redis("web_out");
|
||||||
$data = check_redis("web_out");
|
if (!empty($arr)) {
|
||||||
if ($data["STATUS"]==2) echo "NEW";
|
foreach ($arr as $key=>$data) {
|
||||||
elseif ($data["STATUS"]==1) echo "EXISTS";
|
if ($data["INSTALL_STATUS"]==2) echo "NEW";
|
||||||
|
elseif ($data["INSTALL_STATUS"]==1) echo "EXISTS";
|
||||||
|
redis_remove("$key");
|
||||||
|
}
|
||||||
|
}
|
||||||
else echo "WAIT";
|
else echo "WAIT";
|
||||||
break;
|
break;
|
||||||
case "docker":
|
case "docker":
|
||||||
|
Reference in New Issue
Block a user