Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Expose stop timer through rest api. #1886

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openpype/modules/timers_manager/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

log = Logger().get_logger("Event processor")


class TimersManagerModuleRestApi:
"""
REST API endpoint used for calling from hosts when context change
Expand All @@ -22,6 +23,11 @@ def register(self):
self.prefix + "/start_timer",
self.start_timer
)
self.server_manager.add_route(
"POST",
self.prefix + "/stop_timer",
self.stop_timer
)

async def start_timer(self, request):
data = await request.json()
Expand All @@ -38,3 +44,7 @@ async def start_timer(self, request):
self.module.stop_timers()
self.module.start_timer(project_name, asset_name, task_name, hierarchy)
return Response(status=200)

async def stop_timer(self, request):
self.module.stop_timers()
return Response(status=200)