Skip to content

Commit

Permalink
fix: reading voluba web service jsonld
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed May 25, 2023
1 parent fafcba3 commit d928a3d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions backend/voluba_backend/ebrains_router/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ class JobProgressModel(BaseModel):
def run(self, context:'WorkProgress'):
logger.debug(f"Running {self.name}")
self.status = JobProgressEnum.RUNNING
self._run(context)
logger.debug(f"Running {self.name} completed!")
self.status = JobProgressEnum.COMPLETED
try:
self._run(context)
except Exception as e:
self.status = JobProgressEnum.ERROR
self.detail = str(e)
else:
logger.debug(f"Running {self.name} completed!")
self.status = JobProgressEnum.COMPLETED

def _run(self, context: 'WorkProgress'):
raise NotImplementedError
Expand Down Expand Up @@ -136,7 +141,7 @@ def _run(self, context: 'WorkProgress'):
# TODO s2s token cannot seem to query instances in review space
# personal tokens do not suffer from this limitation, which is why on webUI, everything seems fine
# for now, load the jsonld (fetched and saved while using a personal token)
path_to_jsonld = Path(__file__).parent / "voluba_webservice_jsonld.json",
path_to_jsonld = Path(__file__).parent / "voluba_webservice_jsonld.json"
with open(path_to_jsonld, "r") as fp:
KG_INSTANCES.voluba_webservice_version = WebServiceVersion.from_jsonld(json.load(fp=fp), kg_client)

Expand Down

0 comments on commit d928a3d

Please sign in to comment.