Skip to content

Commit

Permalink
3.0.3: fix stream waiting bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisamin committed Nov 18, 2022
1 parent 3da70d9 commit c999953
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release History
===============
3.0.3 (release 2022-11-18)
--------------------------
- Fix issue where the measure command would continue to stream results after all probes have responded

3.0.2 (release 2022-05-23)
--------------------------
- Fix "measure spec" command which was broken due to cousteau issue
Expand Down
11 changes: 6 additions & 5 deletions ripe/atlas/tools/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .settings import conf


class CaptureLimitExceeded(Exception):
class CaptureLimitMet(Exception):
pass


Expand Down Expand Up @@ -62,11 +62,12 @@ def on_result_response(result, *args):
stream.timeout(self.STREAM_INTERVAL)
for result in results:
self.num_results += 1
if self.capture_limit and self.num_results > self.capture_limit:
raise CaptureLimitExceeded()
yield result
if self.capture_limit and self.num_results == self.capture_limit:
raise CaptureLimitMet()
results = []
if self.timeout is not None:
remaining = start + self.timeout - time.time()
except (KeyboardInterrupt, CaptureLimitExceeded):
stream.disconnect()
except (KeyboardInterrupt, CaptureLimitMet):
pass
stream.disconnect()
2 changes: 1 addition & 1 deletion ripe/atlas/tools/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__version__ = "3.0.2"
__version__ = "3.0.3"

0 comments on commit c999953

Please sign in to comment.