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