Browse Source

Added lastrun to database

main
Jeroen De Meerleer 2 years ago
parent
commit
ceaa6ae570
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      database.sql
  2. +1
    -1
      webcron.php

+ 1
- 0
database.sql View File

@ -59,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `jobs` (
`host` varchar(50) NOT NULL DEFAULT 'localhost',
`delay` int(11) NOT NULL,
`nextrun` int(11) NOT NULL,
`lastrun` int(11) NOT NULL DEFAULT '-1',
`expected` int(11) NOT NULL DEFAULT '200',
PRIMARY KEY (`jobID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


+ 1
- 1
webcron.php View File

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


Loading…
Cancel
Save