Skip to content

Commit

Permalink
Merge pull request #1580 from max-rocket-internet/debug_log_fix
Browse files Browse the repository at this point in the history
Don't log state change if it's the same
  • Loading branch information
cyberw authored Sep 30, 2020
2 parents bfd98b1 + 5e4b1b7 commit 8ef212d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def update_state(self, new_state):
"""
Updates the current state
"""
logger.debug("Updating state to %s, old state was %s" % (new_state, self.state))
logger.debug("Updating state to '%s', old state was '%s'" % (new_state, self.state))
self.state = new_state

def cpu_log_warning(self):
Expand Down Expand Up @@ -618,8 +618,10 @@ def quit(self):
self.greenlet.kill(block=True)

def check_stopped(self):
if not self.state == STATE_INIT and all(
map(lambda x: x.state != STATE_RUNNING and x.state != STATE_SPAWNING, self.clients.all)
if (
not self.state == STATE_INIT
and not self.state == STATE_STOPPED
and all(map(lambda x: x.state != STATE_RUNNING and x.state != STATE_SPAWNING, self.clients.all))
):
self.update_state(STATE_STOPPED)

Expand Down

0 comments on commit 8ef212d

Please sign in to comment.