Skip to content

Commit 0cb1f11

Browse files
authored
Merge pull request #191 from mapswipe/dev
postgres setup and task upload
2 parents 70d6682 + b188cad commit 0cb1f11

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mapswipe_workers/mapswipe_workers/base/base_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ def save_to_firebase(self, fb_db, project, groups, groupsOfTasks):
188188
task_upload_dict = {}
189189

190190
logger.info(f'there are {len(groupsOfTasks)} groups for this project')
191+
c = 0
191192
for group_id, tasks_list in groupsOfTasks.items():
193+
c += 1
192194
task_upload_dict[f'v2/tasks/{self.projectId}/{group_id}'] = tasks_list
193195

194-
if len(task_upload_dict) % 150 == 0:
196+
if len(task_upload_dict) % 150 == 0 or c == len(groupsOfTasks):
195197
ref.update(task_upload_dict)
196198
logger.info(
197199
f'{self.projectId} -'

postgres/initdb.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ CREATE TABLE IF NOT EXISTS projects (
1818
project_details varchar,
1919
project_id varchar,
2020
project_type int,
21-
project_type_specifics json,
2221
required_results int,
2322
result_count int,
2423
status varchar,
2524
verification_number int,
25+
project_type_specifics json,
2626
PRIMARY KEY(project_id)
2727
);
2828

0 commit comments

Comments
 (0)