Update the formatting of the sanity API code
This commit is contained in:
14
api.php
14
api.php
@@ -678,14 +678,12 @@ if ($q == "getAddress") {
|
||||
$account = san($account);
|
||||
|
||||
api_echo($acc->account2alias($account));
|
||||
} elseif ($q=="sanity"){
|
||||
$sanity=false;
|
||||
if(file_exists("tmp/sanity-lock")) {
|
||||
$sanity=true;
|
||||
}
|
||||
$last_sanity=$db->single("SELECT val FROM config WHERE cfg='sanity_last'");
|
||||
$sanity_sync=$db->single("SELECT val FROM config WHERE cfg='sanity_sync'");
|
||||
api_echo(["sanity_running"=>$sanity,"last_sanity"=>$last_sanity, "sanity_sync"=>$sanity_sync]);
|
||||
} elseif ($q === 'sanity') {
|
||||
$sanity = file_exists(__DIR__.'/tmp/sanity-lock');
|
||||
|
||||
$lastSanity = $db->single("SELECT val FROM config WHERE cfg='sanity_last'");
|
||||
$sanitySync = $db->single("SELECT val FROM config WHERE cfg='sanity_sync'");
|
||||
api_echo(['sanity_running' => $sanity, 'last_sanity' => $lastSanity, 'sanity_sync' => $sanitySync]);
|
||||
} elseif ($q=="node-info"){
|
||||
$dbversion=$db->single("SELECT val FROM config WHERE cfg='dbversion'");
|
||||
$hostname=$db->single("SELECT val FROM config WHERE cfg='hostname'");
|
||||
|
||||
Reference in New Issue
Block a user