示例#1
0
def main():
    """Main code for worker."""
    while True:

        domains_iter = repository.iregistered_domains()

        while True:
            try:
                domain = domains_iter.next()
            except StopIteration:
                break

            process_domain(domain)

        print 'All statistics for all deltas processed'

        time.sleep(60)
示例#2
0
def main():
    """Main code for worker."""
    while True:

        start = time.time()

        domains_iter = repository.iregistered_domains()

        while True:
            try:
                domain = domains_iter.next()
            except StopIteration:
                break

            process_domain(domain)

        print 'All deltas processed in {} seconds'.format(
            round(time.time() - start, 2))

        time.sleep(60)
示例#3
0
def main():
    """Main code for worker."""
    while True:

        print 'Starting delta processing...'

        start = time.time()

        domains_iter = repository.iregistered_domains()

        while True:
            try:
                domain = domains_iter.next()
            except StopIteration:
                break

            process_domain(domain)

        print 'All deltas processed in {} seconds'.format(
            round(time.time() - start, 2))

        time.sleep(datetime.timedelta(minutes=15).total_seconds())
示例#4
0
            delta_report['new'].append((dom, new_ip))

    for dom in existing_report.keys():
        if dom not in new_report.keys():
            delta_report['deleted'].append(dom)

    repository.update_delta_report(domain, delta_report)

    print 'Updated deltas for {} in {} seconds'.format(
        domain, time.time() - start
    )


if __name__ == '__main__':
    while True:

        domains_iter = repository.iregistered_domains()

        while True:
            try:
                domain = domains_iter.next()
            except StopIteration:
                break

            process_domain(domain)

        print 'All deltas processed'

        time.sleep(60)