aurweb/aurweb/scripts/pkgmaint.py
Lukas Fleischer 37188603b5 Make maintenance scripts installable
Add wrappers for the maintenance scripts to the setuptools
configuration.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:23:13 +02:00

20 lines
340 B
Python
Executable file

#!/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()