from concurrent.futures import ThreadPoolExecutor, TimeoutError

from .tracker import Tracker


MAX_WAIT_SECONDS = 10


def main():
    tracker = Tracker()
    with ThreadPoolExecutor(max_workers=1) as executor:
        future = executor.submit(tracker.track)
        try:
            future.result(timeout=MAX_WAIT_SECONDS)
        except TimeoutError:
            # Never block package install.
            return 0
        except Exception:
            return 0
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
