new = 0

    for i in range(FETCH_DAYS):
        try:
            new += fetch_log_day(now)
        except Exception, e:
            print e

        now -= datetime.timedelta(days=1)

    print '%s Added %d new patchsets' %(datetime.datetime.now(), new)

    while perform_git_fetches():
        process_patchsets()
    process_patchsets()

    cursor = utils.get_cursor()
    for ident, number in rechecks:
        for ts in rechecks[(ident, number)]:
            cursor.execute('insert ignore into patchset_rechecks '
                           '(id, number, timestamp) values ("%s", %s, %s);'
                           %(ident, number, utils.datetime_as_sql(ts)))
            if cursor.rowcount:
                delta = datetime.datetime.now() - ts
                if delta.days > 3:
                    print 'Recheck ignored because it is older than three days'
                else:
                    print 'Recheck'
                    workunit.recheck(cursor, ident, number)
            cursor.execute('commit;')
Example #2
0
#!/usr/bin/python

# Args are:
#  change id
#  number

import sys

import utils
import workunit


cursor = utils.get_cursor()
workunit.recheck(cursor, sys.argv[1], sys.argv[2])