Skip to content

Commit 7f02dcc

Browse files
author
Matthew Fisher
committed
ref(controller): switch to xrange
`range` returns a copy of the list in-memory at the first iteration, whereas `xrange` lazily evaluates, causing only one value present during runtime. Ergo, it is faster and more efficient.
1 parent baa61e3 commit 7f02dcc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

controller/api/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def _healthcheck(self, containers, config):
381381
# HACK (bacongobbler): we need to wait until publisher has a chance to publish each
382382
# service to etcd, which can take up to 20 seconds.
383383
time.sleep(20)
384-
for i in range(len(intervals)):
384+
for i in xrange(len(intervals)):
385385
delay = int(config.get('HEALTHCHECK_INITIAL_DELAY', 0))
386386
try:
387387
# sleep until the initial timeout is over

0 commit comments

Comments
 (0)