Skip to content

Commit 473dbba

Browse files
committed
added explaination
1 parent 00d0cce commit 473dbba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mapswipe_workers/mapswipe_workers/firebase_to_postgres/transfer_results.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def transfer_results_for_project(project_id, results, filter_mode: bool = False)
9292
truncate_temp_results()
9393
save_results_to_postgres(results_file, project_id, filter_mode=filter_mode)
9494
except psycopg2.errors.ForeignKeyViolation as e:
95+
9596
sentry.capture_exception(e)
9697
sentry.capture_message(
9798
"could not transfer results to postgres due to ForeignKeyViolation: "
@@ -102,6 +103,12 @@ def transfer_results_for_project(project_id, results, filter_mode: bool = False)
102103
"could not transfer results to postgres due to ForeignKeyViolation: "
103104
f"{project_id}; filter_mode={filter_mode}"
104105
)
106+
107+
# There is an exception where additional invalid tasks are in a group.
108+
# If that happens we arrive here and add the flag filtermode=true
109+
# to this function, which could solve the issue in save_results_to_postgres.
110+
# If it does not solve the issue we arrive again but
111+
# since filtermode is already true, we will not try to transfer results again.
105112
if not filter_mode:
106113
transfer_results_for_project(project_id, results, filter_mode=True)
107114
except Exception as e:

0 commit comments

Comments
 (0)