Skip to content

Commit 9766008

Browse files
committed
1 parent 12d0914 commit 9766008

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mapswipe_workers/mapswipe_workers/firebase_to_postgres/update_data.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ def update_user_data(user_ids=None):
2020
ORDER BY created DESC
2121
LIMIT 1
2222
'''
23-
last_updated = pg_db.retr_query(pg_query)
23+
last_updated = pg_db.retr_query(pg_query)[][]
24+
logger.info(f'got last updated timestamp: {last_updated}')
25+
2426
if last_updated is None:
2527
# No users in the Postgres database yet.
2628
# Get all users from Firebase.
2729
users = fb_ref.get()
2830
print(users)
2931
else:
3032
# Get only new users from Firebase.
31-
print(last_updated)
32-
last_updated = last_updated[0][0]
33-
print(last_updated)
3433
last_updated = last_updated.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
3534
fb_query = fb_ref.order_by_child('created').start_at(last_updated)
3635
users = fb_query.get()

0 commit comments

Comments
 (0)