Create a task that won't be garbage-collected before completion.
(coro: Coroutine)
| 17 | |
| 18 | |
| 19 | def _create_safe_task(coro: Coroutine) -> asyncio.Task: |
| 20 | """Create a task that won't be garbage-collected before completion.""" |
| 21 | task = asyncio.create_task(coro) |
| 22 | task.add_done_callback(_background_tasks.discard) |
| 23 | _background_tasks.add(task) |
| 24 | return task |
| 25 | |
| 26 | |
| 27 | class SaaSGitHubService(GitHubService): |
no test coverage detected