mozilla-services / telescope

A dumb auditing service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add async lock/mutex around check run and cache

leplatrem opened this issue · comments

The current code of a check endpoint is rather stupid...

result = cache.get(cache_key)
if result has expired:
    result = check.run()
    cache.set(cache_key, result)

So concretely, a check can run twice in parallel, whereas it one should just wait for the other execution to finish and return its result