diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ python3-swh.core (>= 0.0.28~), python3-swh.model (>= 0.0.18~), python3-swh.objstorage (>= 0.0.17~), - python3-swh.scheduler (>= 0.0.11~), + python3-swh.scheduler (>= 0.0.26~), python3-swh.storage (>= 0.0.100~), python3-vcversioner Standards-Version: 3.9.6 @@ -27,7 +27,7 @@ Depends: python3-swh.core (>= 0.0.28~), python3-swh.model (>= 0.0.18~), python3-swh.objstorage (>= 0.0.17~), - python3-swh.scheduler (>= 0.0.11~), + python3-swh.scheduler (>= 0.0.26~), python3-swh.storage (>= 0.0.100~), ${misc:Depends}, ${python3:Depends} diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,5 +1,5 @@ swh.core >= 0.0.40 swh.model >= 0.0.18 swh.objstorage >= 0.0.17 -swh.scheduler >= 0.0.11 +swh.scheduler >= 0.0.26 swh.storage >= 0.0.100 diff --git a/swh/vault/api/server.py b/swh/vault/api/server.py --- a/swh/vault/api/server.py +++ b/swh/vault/api/server.py @@ -1,4 +1,4 @@ -# Copyright (C) 2016 The Software Heritage developers +# Copyright (C) 2016-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -41,7 +41,12 @@ }), 'client_max_size': ('int', 1024 ** 3), 'db': ('str', 'dbname=softwareheritage-vault-dev'), - 'scheduling_db': ('str', 'dbname=softwareheritage-scheduler-dev'), + 'scheduler': ('dict', { + 'cls': 'remote', + 'args': { + 'url': 'http://localhost:5008/', + } + }), } diff --git a/swh/vault/backend.py b/swh/vault/backend.py --- a/swh/vault/backend.py +++ b/swh/vault/backend.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 The Software Heritage developers +# Copyright (C) 2017-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -11,7 +11,7 @@ from email.mime.text import MIMEText from swh.model import hashutil -from swh.scheduler.backend import SchedulerBackend +from swh.scheduler import get_scheduler from swh.scheduler.utils import create_oneshot_task_dict from swh.vault.cache import VaultCache from swh.vault.cookers import get_cooker @@ -109,9 +109,8 @@ self.db = None self.reconnect() self.smtp_server = smtplib.SMTP() - if self.config['scheduling_db'] is not None: - self.scheduler = SchedulerBackend( - scheduling_db=self.config['scheduling_db']) + if self.config['scheduler'] is not None: + self.scheduler = get_scheduler(**self.config['scheduler']) def reconnect(self): """Reconnect to the database.""" diff --git a/swh/vault/tests/vault_testing.py b/swh/vault/tests/vault_testing.py --- a/swh/vault/tests/vault_testing.py +++ b/swh/vault/tests/vault_testing.py @@ -50,7 +50,7 @@ } }, 'db': 'postgresql:///' + self.TEST_VAULT_DB_NAME, - 'scheduling_db': None, + 'scheduler': None, } self.vault_backend = VaultBackend(self.vault_config)