aurweb/scripts/pkgmaint.py
Lukas Fleischer 8c99184f6d Use config and db in scripts
Instead of using configparser and mysql.connector directly, change all
Python scripts to use the config and db Python modules which are now
accessible from a common location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:23 +02:00

18 lines
320 B
Python
Executable file

#!/usr/bin/python3
import aurweb.db
def main():
conn = aurweb.db.Connection()
conn.execute("DELETE FROM PackageBases WHERE " +
"UNIX_TIMESTAMP() - SubmittedTS > 86400 " +
"AND PackagerUID IS NULL")
conn.commit()
conn.close()
if __name__ == '__main__':
main()