Parser pid renew
This commit is contained in:
parent
2958009bc1
commit
d411680b1b
|
@ -3,35 +3,39 @@
|
|||
require_once 'common.php';
|
||||
|
||||
$db = Db::getInstance();
|
||||
|
||||
$rows = $db->getRows($db->q("SELECT status, count(*) as cnt FROM beathaven.queue GROUP BY status"));
|
||||
|
||||
$info = array_fill(0, 3, 0);
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$info[$row['status']] = $row['cnt'];
|
||||
}
|
||||
|
||||
$tmp = exec("ps aux | grep parse_queue");
|
||||
$pid = @file_get_contents('/www/parser_data/pid');
|
||||
$tmp = exec("ps ". $pid);
|
||||
$running = (strpos($tmp, '/opt/local/bin/php') !== false) ? 1 : 0;
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>BeatHaven</title>
|
||||
<style>
|
||||
body, td {padding:0;margin:0;}
|
||||
body {background-color:#112;}
|
||||
.status-1 {font: 10em Georgia; color: #FFF;}
|
||||
.status-02 {font: 0.8em Georgia; color: #AAA;}
|
||||
.running-1 {font: 0.8em Georgia; color: #8A8;}
|
||||
.running-0 {font: 0.8em Georgia; color: #A88;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" height="100%"><tr><td align="center" valign="middle">
|
||||
<span class="status-1"><?= $info[1] ?></span><span class="status-02"> / <?= $info[0] ?> / <?= $info[2] ?></span>
|
||||
<span class="running-<?= $running ?>"><?= ($running ? 'running' : 'stopped') ?></span>
|
||||
</td></tr></table>
|
||||
</body>
|
||||
<head>
|
||||
<title>BeatHaven</title>
|
||||
<meta http-equiv="refresh" content="5" />
|
||||
<style>
|
||||
body, td {padding:0;margin:0;}
|
||||
body {background-color:#112;}
|
||||
.status-1 {font: 10em Georgia; color: #FFF;}
|
||||
.status-02 {font: 0.8em Georgia; color: #AAA;}
|
||||
.running-1 {font: 0.8em Georgia; color: #8A8;}
|
||||
.running-0 {font: 0.8em Georgia; color: #A88;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" height="100%">
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<div style="float:left;width:100px;height:1;"> </div>
|
||||
<span class="status-1"><?= $info[1] ?></span>
|
||||
<span class="status-02"> / <?= $info[0] ?> / <?= $info[2] ?></span>
|
||||
<span class="running-<?= $running ?>"><?= ($running ? 'running' : 'stopped') ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue