Fixed bugs

This commit is contained in:
Jeroen De Meerleer 2019-05-24 18:41:28 +02:00
parent 9dde6495cd
commit 0809cd3c4b
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!$eternal) { if (!$eternal) {
$lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']); $lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']);
$lastrun = $nextrunObj->getTimestamp(); $lastrun = $lastrunObj->getTimestamp();
} else { } else {
$lastrun = -1; $lastrun = -1;
} }

View File

@ -81,7 +81,7 @@ elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!$eternal) { if (!$eternal) {
$lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']); $lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']);
$lastrun = $nextrunObj->getTimestamp(); $lastrun = $lastrunObj->getTimestamp();
} else { } else {
$lastrun = -1; $lastrun = -1;
} }

View File

@ -67,7 +67,7 @@ if (file_exists("cache/get-services.trigger")) {
} }
} }
$stmt = $db->prepare('SELECT * FROM jobs WHERE nextrun <= 1558742600 and (nextrun <= lastrun OR lastrun = -1)'); $stmt = $db->prepare('SELECT * FROM jobs WHERE nextrun <= ? and (nextrun <= lastrun OR lastrun = -1)');
$stmt->execute(array(time())); $stmt->execute(array(time()));
$results = $stmt->fetchAll(PDO::FETCH_ASSOC); $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();