Skip to content

Commit

Permalink
Limit size of "stuck" services' queues
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Aug 24, 2018
1 parent 15bd4d0 commit 82498d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '18.8.0'
_release = '1591'
_commit = '98c4fe5'
_release = '1592'
_commit = '15bd4d0'
6 changes: 6 additions & 0 deletions src/pywws/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def do_catchup(self, do_all=False):
self.queue_data(data['idx'], data, False)

def upload(self, live_data=None, test_mode=False, option=''):
if self.queue.full():
return
if test_mode:
idx = self.context.calib_data.before(datetime.max)
else:
Expand All @@ -202,6 +204,8 @@ def do_catchup(self, do_all=False):
pass

def upload(self, live_data=None, test_mode=False, option=''):
if self.queue.full():
return
if live_data:
data = live_data
else:
Expand Down Expand Up @@ -235,6 +239,8 @@ def do_catchup(self, do_all=False):
self.upload(option='CATCHUP')

def upload(self, live_data=None, option=''):
if self.queue.full():
return
self.queue.append(option)

def upload_batch(self):
Expand Down

0 comments on commit 82498d3

Please sign in to comment.