summaryrefslogtreecommitdiff
path: root/aurweb/scripts/pkgmaint.py
diff options
context:
space:
mode:
Diffstat (limited to 'aurweb/scripts/pkgmaint.py')
-rwxr-xr-xaurweb/scripts/pkgmaint.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/aurweb/scripts/pkgmaint.py b/aurweb/scripts/pkgmaint.py
new file mode 100755
index 0000000..3ad9ed8
--- /dev/null
+++ b/aurweb/scripts/pkgmaint.py
@@ -0,0 +1,20 @@
+#!/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 " +
+ "SubmittedTS < ? AND PackagerUID IS NULL", [limit_to])
+
+ conn.commit()
+ conn.close()
+
+
+if __name__ == '__main__':
+ main()