Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SeptemberHX committed Mar 21, 2022
1 parent 5c8d5f9 commit 2986d44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions users.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_users(user_data_path):
return users


def request(user_id, func_obj):
def send_request(user_id, func_obj):
# todo: 同步请求,而非异步!
gateway = 'https://localhost:8081/gateway/request'
data = {
Expand Down Expand Up @@ -80,8 +80,8 @@ def simulate_user(self):
i = 1
func_i = 0
while self._running:
func_i = func_i % len(self.func_list)
request(f'{self.user_id}_{i}', self.func_map[self.func_list[func_i]])
func_i = func_i % len(self.user_data)
send_request(f'{self.user_id}_{i}', self.func_map[self.user_data[func_i]])
sleep(random.randint(0, 5))

def stop(self):
Expand Down

0 comments on commit 2986d44

Please sign in to comment.