Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/backend.py
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | def create_tasks(self, tasks, policy='recurring', db=None, cur=None): | ||||
task | task | ||||
Returns: | Returns: | ||||
a list of created tasks. | a list of created tasks. | ||||
""" | """ | ||||
cur.execute('select swh_scheduler_mktemp_task()') | cur.execute('select swh_scheduler_mktemp_task()') | ||||
db.copy_to(tasks, 'tmp_task', self.task_create_keys, | db.copy_to(tasks, 'tmp_task', self.task_create_keys, | ||||
default_columns={ | default_values={ | ||||
'policy': policy, | 'policy': policy, | ||||
'status': 'next_run_not_scheduled' | 'status': 'next_run_not_scheduled' | ||||
}, | }, | ||||
cur=cur) | cur=cur) | ||||
query = format_query( | query = format_query( | ||||
'select {keys} from swh_scheduler_create_tasks_from_temp()', | 'select {keys} from swh_scheduler_create_tasks_from_temp()', | ||||
self.task_keys, | self.task_keys, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |