Skip to content

Commit

Permalink
services: skip index rebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Jul 11, 2024
1 parent e4749f4 commit fcb550d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions invenio_jobs/services/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit fcb550d

Please sign in to comment.