Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
wip: data's moving but it's lossy with a bad connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Sarwar committed Dec 6, 2018
1 parent b6a079d commit cfc24b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firebase/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_messages(self):
return self.consumer.poll_and_deserialize(
timeout_ms=self.consumer_timeout,
max_records=self.consumer_max_records)
except TypeError as ter: # consumer is likely None
except AttributeError as ter: # consumer is likely None
LOG.error(f'{self.name} died with error {ter}')
self.status = WorkerStatus.ERRORED

Expand Down Expand Up @@ -394,14 +394,14 @@ def configure(self):
self.status = WorkerStatus.LOCKED
self.sync_mode = new_mode
return
self.consumer = self.get_consumer()
self.get_consumer()
self.status = WorkerStatus.RUNNING

def handle_messages(self, messages):
msg_iter = super().handle_messages(messages)
for schema, messages in msg_iter:
for msg in messages:
submit(msg) # RTDB cares not for schema enforcement
self.submit(msg) # RTDB cares not for schema enforcement

def submit(self, msg):
try:
Expand All @@ -427,7 +427,7 @@ class CFSWorker(FirebaseWorker):

def configure(self):
super().configure()
self.consumer = self.get_consumer()
self.get_consumer()
self.status = WorkerStatus.RUNNING

def handle_messages(self, messages):
Expand Down

0 comments on commit cfc24b4

Please sign in to comment.