Skip to content

Commit aaa44df

Browse files
committed
adjust transfer results function
1 parent d18da84 commit aaa44df

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

mapswipe_workers/mapswipe_workers/firebase_to_postgres/transfer_results.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
def transfer_results(project_id_list=None):
1313
"""Transfer results for one project after the other.
14-
1514
Will only trigger the transfer of results for projects
1615
that are defined in the postgres database.
1716
Will not transfer results for tutorials and
@@ -57,28 +56,22 @@ def transfer_results(project_id_list=None):
5756

5857
def transfer_results_for_project(project_id, results):
5958
"""Transfer the results for a specific project.
60-
6159
Save results into an in-memory file.
6260
Copy the results to postgres.
6361
Delete results in firebase.
64-
6562
We are NOT using a Firebase transaction functions here anymore.
6663
This has caused problems, in situations where a lot of mappers are
6764
uploading results to Firebase at the same time. Basically, this is
6865
due to the behaviour of Firebase Transaction function:
69-
7066
"If another client writes to this location
7167
before the new value is successfully saved,
7268
the update function is called again with the new current value,
7369
and the write will be retried."
74-
7570
(source: https://firebase.google.com/docs/reference/admin/python/firebase_admin.db#firebase_admin.db.Reference.transaction) # noqa
76-
7771
Using Firebase transaction on the group level
7872
has turned out to be too slow when using "normal" queries,
7973
e.g. without using threading. Threading should be avoided here
8074
as well to not run into unforeseen errors.
81-
8275
For more details see issue #478.
8376
"""
8477

@@ -125,7 +118,6 @@ def transfer_results_for_project(project_id, results):
125118

126119
def delete_results_from_firebase(project_id, results):
127120
"""Delete results from Firebase using update function.
128-
129121
We use the update method of firebase instead of delete.
130122
Update allows to delete items at multiple locations at the same time
131123
and is much faster.

0 commit comments

Comments
 (0)