diff --git a/cads_broker/dispatcher.py b/cads_broker/dispatcher.py index fdf16ce1..9a45809d 100644 --- a/cads_broker/dispatcher.py +++ b/cads_broker/dispatcher.py @@ -219,7 +219,6 @@ def on_future_done(self, future: distributed.Future) -> None: job_id=request.request_uid, ) return - logger.info(f"{type(future.key)} - {future.key}") self.futures.pop(future.key) self.qos.notify_end_of_request(request, session) logger.info( @@ -249,12 +248,12 @@ def submit_request( resources=request.request_metadata.get("resources", {}), metadata=request.request_metadata, ) + self.futures[request.request_uid] = future future.add_done_callback(self.on_future_done) request = db.set_request_status( request_uid=request.request_uid, status="running", session=session ) self.qos.notify_start_of_request(request, session) - self.futures[request.request_uid] = future logger.info( "submitted job to scheduler", **db.logger_kwargs(request=request),