def task_is_running(): try: with FileLockOrFail(LOCKNAME): return False except CannotLock: return True
def update(force_start=False, **kwargs): try: with FileLockOrFail(LOCKNAME): return update_main(force_start, **kwargs) except CannotLock: return 0