Skip to content

Commit

Permalink
Merge pull request #1671 from stanislawskwark/patch-1
Browse files Browse the repository at this point in the history
/swarm adjusted for tests with shape class
  • Loading branch information
cyberw authored Jan 4, 2021
2 parents 11de532 + ceffa15 commit 01087c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ def index():
@self.auth_required_if_enabled
def swarm():
assert request.method == "POST"
user_count = int(request.form["user_count"])
spawn_rate = float(request.form["spawn_rate"])

if request.form.get("host"):
# Replace < > to guard against XSS
Expand All @@ -146,6 +144,8 @@ def swarm():
return jsonify(
{"success": True, "message": "Swarming started using shape class", "host": environment.host}
)
user_count = int(request.form["user_count"])
spawn_rate = float(request.form["spawn_rate"])

environment.runner.start(user_count, spawn_rate)
return jsonify({"success": True, "message": "Swarming started", "host": environment.host})
Expand Down

0 comments on commit 01087c7

Please sign in to comment.