Skip to content

Commit eb84c93

Browse files
authored
Merge branch 'import-update-date' of 'https://github.com/jjmerchante/grimoirelab-sortinghat'
Merges #1016 Closes #1016
2 parents 161c8d8 + d039c51 commit eb84c93

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Importer job rescheduled fixed
3+
category: fixed
4+
author: Jose Javier Merchante <[email protected]>
5+
issue: null
6+
notes: >
7+
Fixes a bug that caused the importer to always use the same
8+
start date when importing identities after being rescheduled.
9+
It now uses the start date of the current job as from_date
10+
for the next execution.

sortinghat/core/jobs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,13 @@ def on_success_job(job, connection, result, *args, **kwargs):
947947
task.executions = task.executions + 1
948948
task.failed = False
949949

950-
# Detect if the importer backend uses 'update_from' argument and update it
950+
# Detect if the importer backend uses 'from_date' argument and update it
951951
if task.job_type == 'import_identities':
952952
backends = find_import_identities_backends()
953953
backend_name = task.args['backend_name']
954-
if 'update_from' in backends[backend_name]['args']:
955-
task.args['params']['update_from'] = task.scheduled_datetime
954+
if 'from_date' in backends[backend_name]['args']:
955+
job.kwargs['from_date'] = task.scheduled_datetime
956+
task.args['from_date'] = task.scheduled_datetime
956957

957958
if not task.interval:
958959
logger.info("Interval not defined, not rescheduling task.")

0 commit comments

Comments
 (0)