diff options
author | 2010-01-30 21:20:36 +0000 | |
---|---|---|
committer | 2010-01-30 21:20:36 +0000 | |
commit | ae690d49aa77ce916882a7b003501a6b10adb87a (patch) | |
tree | 5a30cee522fc81db60374b60b5357c10f39e2b56 | |
parent | import bugs directly, dont use copy (diff) | |
download | znurt-org-backend-ae690d49aa77ce916882a7b003501a6b10adb87a.tar.gz znurt-org-backend-ae690d49aa77ce916882a7b003501a6b10adb87a.tar.bz2 znurt-org-backend-ae690d49aa77ce916882a7b003501a6b10adb87a.zip |
Use postgres to calcuate the time intervals
git-svn-id: file:///var/svn/portage@75 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
-rw-r--r-- | import.bugzilla.php | 13 |
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; } |