diff --git a/packages/slycat/web/server/handlers.py b/packages/slycat/web/server/handlers.py index bd9b11d41..4a4de37e7 100644 --- a/packages/slycat/web/server/handlers.py +++ b/packages/slycat/web/server/handlers.py @@ -276,6 +276,7 @@ def get_model(mid, **kwargs): context.update(model) context["is-project-administrator"] = slycat.web.server.authentication.is_project_administrator(project) context["new-model-name"] = "Model-%s" % (model_count + 1) + context["worker"] = model.get("worker", "null") marking = cherrypy.request.app.config["slycat"]["marking"] context["marking-html"] = marking.html(model["marking"]) diff --git a/packages/slycat/web/server/worker/model/__init__.py b/packages/slycat/web/server/worker/model/__init__.py index 26057fa51..912b97bec 100644 --- a/packages/slycat/web/server/worker/model/__init__.py +++ b/packages/slycat/web/server/worker/model/__init__.py @@ -251,6 +251,11 @@ def work(self): self.couchdb = slycat.web.server.database.couchdb.connect() self.scidb = slycat.web.server.database.scidb.connect() + # Store the worker ID in the model ... + with self.model_lock: + self.model["worker"] = self.status["_id"] + slycat.web.server.database.couchdb.connect().save(self.model) + # Optionally, wait for clients to add input artifacts to the model ... if self.incremental: self.set_message("Waiting for requests.")