We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@time_trigger('startup') def startup(): log.info('starting') my_task = task.current_task() task.add_done_callback(my_task, all_done) task.sleep(5) def all_done(): log.info('task has ended')
The above code results in the following error:
2021-01-13 06:19:48 ERROR (MainThread) [custom_components.pyscript.scripts.test.uniq2.startup] Exception in <scripts.test.uniq2.startup> line 7: task.add_done_callback(my_task, all_done) ^ KeyError: <Task pending name='Task-6896361' coro=<Function.run_coro() running at /config/custom_components/pyscript/function.py:419>> Traceback (most recent call last): File "/config/custom_components/pyscript/eval.py", line 827, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1757, in ast_call return await self.call_func(func, func_name, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 1787, in call_func return await func(*args, **kwargs) File "/config/custom_components/pyscript/trigger.py", line 178, in user_task_add_done_callback Function.task_add_done_callback(task, ast_ctx, callback, *args, **kwargs) File "/config/custom_components/pyscript/function.py", line 472, in task_add_done_callback cls.task2cb[task]["cb"][callback] = [ast_ctx, args, kwargs] KeyError: <Task pending name='Task-6896361' coro=<Function.run_coro() running at /config/custom_components/pyscript/function.py:419>>
The text was updated successfully, but these errors were encountered:
ea503aa
No branches or pull requests
The above code results in the following error:
The text was updated successfully, but these errors were encountered: