Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ctri-The-Third committed Feb 5, 2024
1 parent bb8c84a commit 6108d6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion straders_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ def request_and_validate(
consumer.queue.put((packaged_request.priority, packaged_request))
if not consumer._consumer_thread.is_alive():
consumer.start()
packaged_request.event.wait()
# if a request gets stuck, the thread will never end and the ship can't be reprioritised.
# e.g. if a ship submits a priority 6 request, it's probs never getting serviced.
# this will def crash the thread - but it will free up the ship for any new behaviour
packaged_request.event.wait(timeout=3600)
return RemoteSpaceTradersRespose(
packaged_request.response, packaged_request.priority
)
Expand Down

0 comments on commit 6108d6a

Please sign in to comment.