lister/tasks: Standardize return statements
The following commit adapts the return statements from both lister and their associated tasks. This standardizes on what other modules (e.g. both dvcs and package loaders) do.
This commit is contained in:
parent
ff7fdf24db
commit
4a9608f31c
15 changed files with 42 additions and 21 deletions
|
@ -78,6 +78,7 @@ class CGitLister(ListerBase):
|
|||
}
|
||||
|
||||
def run(self):
|
||||
status = 'uneventful'
|
||||
total = 0
|
||||
for repos in grouper(self.get_repos(), 10):
|
||||
models = list(filter(None, (self.build_model(repo)
|
||||
|
@ -87,6 +88,9 @@ class CGitLister(ListerBase):
|
|||
self.db_session.commit()
|
||||
total += len(injected_repos)
|
||||
logger.debug('Scheduled %s tasks for %s', total, self.url)
|
||||
status = 'eventful'
|
||||
|
||||
return {'status': status}
|
||||
|
||||
def get_repos(self):
|
||||
"""Generate git 'project' URLs found on the current CGit server
|
||||
|
|
|
@ -10,7 +10,7 @@ from .lister import CGitLister
|
|||
@shared_task(name=__name__ + '.CGitListerTask')
|
||||
def list_cgit(**lister_args):
|
||||
'''Lister task for CGit instances'''
|
||||
CGitLister(**lister_args).run()
|
||||
return CGitLister(**lister_args).run()
|
||||
|
||||
|
||||
@shared_task(name=__name__ + '.ping')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue