Skip to content

Commit

Permalink
fix the requested changes mostly in create_payload
Browse files Browse the repository at this point in the history
  • Loading branch information
salehsedghpour committed Jun 22, 2022
1 parent 79641e7 commit 2febf89
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions model/restful/utils/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from flask import Blueprint, jsonify, request, current_app
from aiohttp import ClientSession
import asyncio
import subprocess
from concurrent.futures import ThreadPoolExecutor, as_completed
import requests
import time
Expand Down Expand Up @@ -224,11 +223,9 @@ def sync_execute_io_bounded_task(source_service, target_service, forward_headers


def create_payload(payload_size):

request_payload = subprocess.run(['cat /dev/urandom | tr -dc "[:alnum:]" | head -c${1:-%s}' % payload_size], capture_output=True, shell=True)
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(int(payload_size)))
return request_payload.stdout.decode("utf-8")
return result_str


def create_response():
Expand Down

0 comments on commit 2febf89

Please sign in to comment.