From fcb550d9c82ec79fee3d64c8d6b629eaa713f53b Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Wed, 10 Jul 2024 21:34:16 +0200 Subject: [PATCH] services: skip index rebuilding --- invenio_jobs/services/services.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/invenio_jobs/services/services.py b/invenio_jobs/services/services.py index 3a4192f..1e450b0 100644 --- a/invenio_jobs/services/services.py +++ b/invenio_jobs/services/services.py @@ -29,7 +29,19 @@ from .errors import JobNotFoundError, RunNotFoundError, RunStatusChangeError -class TasksService(RecordService): +class BaseService(RecordService): + """Base service class for DB-backed services. + + NOTE: See https://github.com/inveniosoftware/invenio-records-resources/issues/583 + for future directions. + """ + + def rebuild_index(self, identity, uow=None): + """Raise error since services are not backed by search indices.""" + raise NotImplementedError() + + +class TasksService(BaseService): """Tasks service.""" def search(self, identity, params): @@ -78,7 +90,7 @@ def get_run(run_id, job_id=None): return run -class JobsService(RecordService): +class JobsService(BaseService): """Jobs service.""" @unit_of_work() @@ -173,7 +185,7 @@ def delete(self, identity, id_, uow=None): return True -class RunsService(RecordService): +class RunsService(BaseService): """Runs service.""" def search(self, identity, job_id, params):