Added lastrun to database
This commit is contained in:
parent
6104aadbf5
commit
8a46143b5d
|
@ -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;
|
||||
|
|
|
@ -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…
Reference in New Issue