Remove debug logging from tasks' code
since this is now handled by the SWHTask itself.
This commit is contained in:
parent
6957f3c435
commit
f670de298f
6 changed files with 36 additions and 98 deletions
|
@ -5,7 +5,6 @@
|
|||
import random
|
||||
|
||||
from celery import group
|
||||
|
||||
from swh.scheduler.celery_backend.config import app
|
||||
|
||||
from .. import utils
|
||||
|
@ -22,34 +21,23 @@ def new_lister(api_baseurl='https://gitlab.com/api/v4',
|
|||
per_page=per_page)
|
||||
|
||||
|
||||
@app.task(name='swh.lister.gitlab.tasks.IncrementalGitLabLister',
|
||||
bind=True)
|
||||
def incremental_gitlab_lister(self, **lister_args):
|
||||
self.log.debug('%s, lister_args=%s' % (
|
||||
self.name, lister_args))
|
||||
@app.task(name=__name__ + '.IncrementalGitLabLister')
|
||||
def incremental_gitlab_lister(**lister_args):
|
||||
lister_args['sort'] = 'desc'
|
||||
lister = new_lister(**lister_args)
|
||||
total_pages = lister.get_pages_information()[1]
|
||||
# stopping as soon as existing origins for that instance are detected
|
||||
lister.run(min_bound=1, max_bound=total_pages, check_existence=True)
|
||||
self.log.debug('%s OK' % (self.name))
|
||||
|
||||
|
||||
@app.task(name='swh.lister.gitlab.tasks.RangeGitLabLister',
|
||||
bind=True)
|
||||
def range_gitlab_lister(self, start, end, **lister_args):
|
||||
self.log.debug('%s(start=%s, end=%d), lister_args=%s' % (
|
||||
self.name, start, end, lister_args))
|
||||
@app.task(name=__name__ + '.RangeGitLabLister')
|
||||
def range_gitlab_lister(start, end, **lister_args):
|
||||
lister = new_lister(**lister_args)
|
||||
lister.run(min_bound=start, max_bound=end)
|
||||
self.log.debug('%s OK' % (self.name))
|
||||
|
||||
|
||||
@app.task(name='swh.lister.gitlab.tasks.FullGitLabRelister',
|
||||
bind=True)
|
||||
@app.task(name=__name__ + '.FullGitLabRelister', bind=True)
|
||||
def full_gitlab_relister(self, **lister_args):
|
||||
self.log.debug('%s, lister_args=%s' % (
|
||||
self.name, lister_args))
|
||||
lister = new_lister(**lister_args)
|
||||
_, total_pages, _ = lister.get_pages_information()
|
||||
ranges = list(utils.split_range(total_pages, NBPAGES))
|
||||
|
@ -64,8 +52,6 @@ def full_gitlab_relister(self, **lister_args):
|
|||
return promise.id
|
||||
|
||||
|
||||
@app.task(name='swh.lister.gitlab.tasks.ping',
|
||||
bind=True)
|
||||
def ping(self):
|
||||
self.log.debug(self.name)
|
||||
@app.task(name=__name__ + '.ping')
|
||||
def ping():
|
||||
return 'OK'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue