Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/cgit/tasks.py
- This file was added.
# Copyright (C) 2019 the Software Heritage developers | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from swh.scheduler.celery_backend.config import app | |||||
from .lister import CGitLister | |||||
def new_lister(base_url='https://git.savannah.gnu.org/cgit/', | |||||
instance='savannah-gnu', **kw): | |||||
return CGitLister(base_url=base_url, instance=instance, **kw) | |||||
@app.task(name=__name__ + '.CGitListerTask') | |||||
def cgit_lister(**lister_args): | |||||
lister = new_lister(**lister_args) | |||||
lister.run() | |||||
@app.task(name=__name__ + '.ping') | |||||
def ping(): | |||||
return 'OK' |