summaryrefslogtreecommitdiffstats
path: root/aurweb/scripts/pkgmaint.py
blob: 3ad9ed8d5480712e7671145c4b85e2cdab5c43c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()