"""Collect configured provider listings and check interests while dealers are offline."""
import argparse,time
from server import db,process_matches,setting,collect
p=argparse.ArgumentParser();p.add_argument('--loop',action='store_true');a=p.parse_args()
while True:
    print('Collector:',collect(),flush=True)
    with db() as c:print('New stored-listing alerts:',process_matches(c),flush=True)
    if not a.loop:break
    time.sleep(int(setting('worker_interval')))
