summaryrefslogtreecommitdiff
path: root/scripts/pkgmaint.py
diff options
context:
space:
mode:
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 d0f8fe7..3ad9ed8 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()