listers: Allow to override policy and priority for scheduled tasks

Prior to this commit, the policy and priority were hard-coded.
The default values are now the old hard-coded values.

This will allow to develop a cli to trigger forges listing with oneshot policy
and some priority tasks. Thus ingesting those faster and without manual
interventation as we currently do.
This commit is contained in:
Antoine R. Dumont (@ardumont) 2019-08-28 11:32:21 +02:00
parent 5727f15cf3
commit 87d2a16df0
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
5 changed files with 17 additions and 6 deletions

View file

@ -27,7 +27,8 @@ class CRANLister(SimpleLister):
needed for the ingestion task creation.
"""
return create_task_dict(
'load-%s' % origin_type, 'recurring',
'load-%s' % origin_type,
kwargs.get('policy', 'recurring'),
kwargs.get('name'), origin_url, kwargs.get('version'),
project_metadata=self.descriptions[kwargs.get('name')])