-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Long running tasks: allow retrieving tasks by user (#3268)
- Loading branch information
Showing
28 changed files
with
1,415 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
packages/service-library/src/servicelib/aiohttp/long_running_tasks/_dependencies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
from typing import Any | ||
|
||
from aiohttp import web | ||
|
||
from ...long_running_tasks._task import TasksManager | ||
from ._constants import APP_LONG_RUNNING_TASKS_MANAGER_KEY | ||
from ._constants import ( | ||
APP_LONG_RUNNING_TASKS_MANAGER_KEY, | ||
RQT_LONG_RUNNING_TASKS_CONTEXT_KEY, | ||
) | ||
|
||
|
||
def get_tasks_manager(app: web.Application) -> TasksManager: | ||
return app[APP_LONG_RUNNING_TASKS_MANAGER_KEY] | ||
|
||
|
||
def get_task_context(request: web.Request) -> dict[str, Any]: | ||
return request[RQT_LONG_RUNNING_TASKS_CONTEXT_KEY] | ||
|
||
|
||
def create_task_name_from_request(request: web.Request) -> str: | ||
return f"{request.method} {request.rel_url}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.