Skip to content
Snippets Groups Projects
Commit d82dd313 authored by Hal Simpson's avatar Hal Simpson
Browse files

Added code to limit crawling back during update.

parent cc870224
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,8 @@ class Controller(object): ...@@ -217,7 +217,8 @@ class Controller(object):
stream=input_timeseries): stream=input_timeseries):
continue continue
# check for fillable gap at start # check for fillable gap at start
if output_gap[0] == options.starttime: if options.update_count < options.update_max_iterations and \
output_gap[0] == options.starttime:
# found fillable gap at start, recurse to previous interval # found fillable gap at start, recurse to previous interval
interval = options.endtime - options.starttime interval = options.endtime - options.starttime
options.starttime = options.starttime - interval - delta options.starttime = options.starttime - interval - delta
...@@ -384,6 +385,7 @@ def main(args): ...@@ -384,6 +385,7 @@ def main(args):
controller = Controller(inputfactory, outputfactory, algorithm) controller = Controller(inputfactory, outputfactory, algorithm)
if args.update: if args.update:
args.update_count = 0
controller.run_as_update(args) controller.run_as_update(args)
else: else:
controller.run(args) controller.run(args)
...@@ -451,6 +453,10 @@ def parse_args(args): ...@@ -451,6 +453,10 @@ def parse_args(args):
action='store_true', action='store_true',
default=False, default=False,
help='Used to update data') help='Used to update data')
parser.add_argument('--update-max-iterations',
type=int,
help='Maximum iterations update will attempt.'
)
parser.add_argument('--input-edge-port', parser.add_argument('--input-edge-port',
type=int, type=int,
default=2060, default=2060,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment