Fix IDLE worker detection
* Also mark as IDLE if no valid shares were received Fixes #561
This commit is contained in:
parent
073a42cfc8
commit
cbf39f7905
@ -75,14 +75,15 @@ class Worker {
|
|||||||
$this->debug->append("STA " . __METHOD__, 4);
|
$this->debug->append("STA " . __METHOD__, 4);
|
||||||
$stmt = $this->mysqli->prepare("
|
$stmt = $this->mysqli->prepare("
|
||||||
SELECT account_id, id, username
|
SELECT account_id, id, username
|
||||||
FROM " . $this->table . "
|
FROM " . $this->table . " AS w
|
||||||
WHERE monitor = 1 AND ( SELECT SIGN(COUNT(id)) FROM " . $this->share->getTableName() . " WHERE username = $this->table.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)) = 0");
|
WHERE monitor = 1
|
||||||
|
AND (
|
||||||
|
SELECT IFNULL(SIGN(IF(our_result = 'Y', COUNT(id), 0)), 0) FROM " . $this->share->getTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
||||||
|
) = 0");
|
||||||
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
|
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
|
||||||
return $result->fetch_all(MYSQLI_ASSOC);
|
return $result->fetch_all(MYSQLI_ASSOC);
|
||||||
// Catchall
|
// Catchall
|
||||||
$this->setErrorMessage("Unable to fetch IDLE, monitored workers");
|
$this->setErrorMessage("Unable to fetch IDLE, monitored workers");
|
||||||
echo $this->mysqli->error;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user