summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--import.bugzilla.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/import.bugzilla.php b/import.bugzilla.php
index 88f4353..5ed9e3a 100644
--- a/import.bugzilla.php
+++ b/import.bugzilla.php
@@ -17,15 +17,16 @@
$import_bugzilla = false;
- // Only run this one once a day
- $sql = "SELECT MAX(idate) FROM package_bugs WHERE status = 0;";
- $max = $db->getOne($sql);
+ $sql = "SELECT COUNT(1) FROM package_bugs WHERE status = 0;";
+ $count = $db->getOne($sql);
- if(is_null($max))
+ if(!$count)
$import_bugzilla = true;
else {
- $max = strtotime($max);
- if(time() - $max >= 86400)
+ // Only run this one once a day
+ $sql = "SELECT interval '1 day' + MAX(idate) < NOW() FROM package_bugs WHERE status = 0;";
+ $bool = $db->getOne($sql);
+ if($bool == 't')
$import_bugzilla = true;
}