Skip to content

Commit 0740843

Browse files
committed
Fix env var and queue size checks
1 parent 40e6636 commit 0740843

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

instana/recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def run(self):
3636
def report_spans(self):
3737
""" Periodically report the queued spans """
3838
while 1:
39-
if self.sensor.agent.can_send() and self.queue.qsize:
39+
if self.sensor.agent.can_send() and self.queue.qsize() > 0:
4040
url = self.sensor.agent.make_url(a.AGENT_TRACES_URL)
4141
self.sensor.agent.request(url, "POST", self.queued_spans())
4242
time.sleep(1)
@@ -66,7 +66,7 @@ def record_span(self, span):
6666
Convert the passed BasicSpan into an InstanaSpan and
6767
add it to the span queue
6868
"""
69-
if self.sensor.agent.can_send() or os.environ["INSTANA_TEST"]:
69+
if self.sensor.agent.can_send() or "INSTANA_TEST" in os.environ:
7070
instana_span = None
7171

7272
if span.operation_name in self.registered_spans:

0 commit comments

Comments
 (0)