Max fixes Dinos problems
This commit is contained in:
parent
1854c3ee27
commit
1094fce783
1 changed files with 14 additions and 14 deletions
|
@ -10,22 +10,22 @@ class ActionQueue:
|
|||
self.idle_action_task = None
|
||||
|
||||
async def run_queue(self):
|
||||
try:
|
||||
while True:
|
||||
if self.queued_actions.empty() and self.idle_action is not None:
|
||||
self.idle_action_task = asyncio.create_task(self.idle_action())
|
||||
# try:
|
||||
while True:
|
||||
if self.queued_actions.empty() and self.idle_action is not None:
|
||||
self.idle_action_task = asyncio.create_task(self.idle_action[0](*(self.idle_action[1]), **(self.idle_action[2])))
|
||||
|
||||
action = await self.queued_actions.get()
|
||||
action = await self.queued_actions.get()
|
||||
|
||||
if self.idle_action_task is not None:
|
||||
self.idle_action_task.cancel()
|
||||
self.idle_action_task = None
|
||||
if self.idle_action_task is not None:
|
||||
self.idle_action_task.cancel()
|
||||
self.idle_action_task = None
|
||||
|
||||
if action is not None: # If none -> Is idle action update
|
||||
await action[0](*(action[1]), **(action[2]))
|
||||
if action is not None: # If none -> Is idle action update
|
||||
await action[0](*(action[1]), **(action[2]))
|
||||
|
||||
except:
|
||||
pass
|
||||
# except:
|
||||
# pass
|
||||
|
||||
async def add_action_to_queue(self, action, *args, **kwargs):
|
||||
await self.queued_actions.put((action, args, kwargs))
|
||||
|
|
Loading…
Reference in a new issue