Skip to content

Commit 74ddd45

Browse files
committed
add analizer main
1 parent c8111ad commit 74ddd45

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

robotcode/analyzer/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def main() -> None:
2+
# TODO: implement commandline analyzer
3+
pass
4+
5+
6+
if __name__ == "__main__":
7+
main()

robotcode/utils/async_tools.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,11 @@ async def async_lock(lock: threading.RLock) -> AsyncGenerator[None, None]:
540540
start_time = time.monotonic()
541541
locked = lock.acquire(blocking=False)
542542
while not locked:
543-
if time.monotonic() - start_time >= 10:
544-
raise RuntimeError("Timeout waiting for lock")
543+
if time.monotonic() - start_time >= 20:
544+
raise TimeoutError("Timeout waiting for lock")
545545

546546
await asyncio.sleep(0.001)
547+
547548
locked = lock.acquire(blocking=False)
548549
try:
549550
yield
@@ -600,7 +601,7 @@ def s(w: asyncio.Future[Any], ev: threading.Event) -> None:
600601
fut._loop.call_soon_threadsafe(s, fut, done)
601602

602603
if not done.wait(120):
603-
raise RuntimeError("Callback timeout")
604+
raise TimeoutError("Callback timeout")
604605

605606
def clear(self) -> None:
606607
with self._lock:
@@ -664,7 +665,7 @@ def s(w: asyncio.Future[Any], ev: threading.Event) -> None:
664665
waiter._loop.call_soon_threadsafe(s, waiter, done)
665666

666667
if not done.wait(120):
667-
raise RuntimeError("Callback timeout")
668+
raise TimeoutError("Callback timeout")
668669

669670
else:
670671
raise RuntimeError("Loop is not running.")

0 commit comments

Comments
 (0)