summaryrefslogtreecommitdiffstats
path: root/scripts/pkgmaint.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-09-21 09:05:56 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-09-29 22:07:24 +0200
commit91f649f5edaae42f616ad9fc2facb90f1d71f9b9 (patch)
tree7d0c504203a6e2e50e991e2f6dd68c0556f5388d /scripts/pkgmaint.py
parentcd2d90612b63711f9d92bff686698b6c37b79b2b (diff)
downloadaur-91f649f5edaae42f616ad9fc2facb90f1d71f9b9.tar.gz
aur-91f649f5edaae42f616ad9fc2facb90f1d71f9b9.tar.xz
scripts: Do not use UNIX_TIMESTAMP
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard. See f2a6bd2 (git-interface: Do not use UNIX_TIMESTAMP, 2016-08-05) for related changes. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'scripts/pkgmaint.py')
-rwxr-xr-xscripts/pkgmaint.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/pkgmaint.py b/scripts/pkgmaint.py
index d0f8fe70..3ad9ed8d 100755
--- a/scripts/pkgmaint.py
+++ b/scripts/pkgmaint.py
@@ -1,14 +1,16 @@
#!/usr/bin/python3
+import time
+
import aurweb.db
def main():
conn = aurweb.db.Connection()
+ limit_to = int(time.time()) - 86400
conn.execute("DELETE FROM PackageBases WHERE " +
- "UNIX_TIMESTAMP() - SubmittedTS > 86400 " +
- "AND PackagerUID IS NULL")
+ "SubmittedTS < ? AND PackagerUID IS NULL", [limit_to])
conn.commit()
conn.close()