MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / _create_safe_task

Function _create_safe_task

enterprise/integrations/github/github_service.py:19–24  ·  view source on GitHub ↗

Create a task that won't be garbage-collected before completion.

(coro: Coroutine)

Source from the content-addressed store, hash-verified

17
18
19def _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
27class SaaSGitHubService(GitHubService):

Callers 2

get_paginated_reposMethod · 0.85
get_all_repositoriesMethod · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected