Worker id

This commit is contained in:
Ruben van de Ven 2020-01-22 20:04:33 +01:00
parent a9f82a5feb
commit bbd5c20d3b

View file

@ -355,6 +355,7 @@ class DrawPageHandler(tornado.web.RequestHandler):
# new assignment
logger.warning(f"Create new assignment {assignmentId}")
assignment = self.store.newAssignment(self.store.currentHit, assignmentId)
assignment.worker_id = str(self.get_query_argument('workerId', ''))
self.store.saveAssignment(assignment)
logger.info(f"Set close timeout for {self.store.getHitTimeout()}")
Server.loop.asyncio_loop.call_later(self.store.getHitTimeout(), WebSocketHandler.timeoutConnectionForAssignment, assignment.assignment_id)