aurweb/aurweb/scripts/pkgmaint.py
Lukas Fleischer cb307bf01a Do not hardcode path to the Python interpreter
Use `/usr/bin/env python3` instead of `/usr/bin/python3` in the shebang
of Python scripts. This adds support for non-standard Python interpreter
paths such as the paths used in virtualenv environments.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-08-25 07:01:12 +02:00

20 lines
344 B
Python
Executable file

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