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

Commit

Permalink
Merge pull request #1886 from tokejepsen/feature/stop_timer_rest_api
Browse files Browse the repository at this point in the history
Expose stop timer through rest api.
  • Loading branch information
iLLiCiTiT authored Jul 30, 2021
2 parents c9d90c1 + 7ec2cf7 commit 64a80d4
Showing 1 changed file with 10 additions and 0 deletions.
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)

0 comments on commit 64a80d4

Please sign in to comment.