Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Red_wolf2467 committed Nov 17, 2024
1 parent 7c1335a commit 04a58cb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import quart, json, reds_simple_logger, colorama, sys, time, string
from quart import Quart, request
from colorama import Fore, Style
Expand Down Expand Up @@ -90,7 +91,7 @@ def hash_string(string: str):
@server.route("/chatfilter")
async def check_message():
start_time = time.time()
id=uuid.uuid1()
id = os.urandom(15).hex()
logger.info(f"Start processing order number chatfilter-{id}")
data = await request.get_json()
badwords = load_data("json/badwords.json")
Expand All @@ -104,7 +105,9 @@ async def check_message():

end_time = time.time()
processing_time = end_time - start_time
logger.info(f"Processing of order number chatfilter-{id} in {processing_time}s completed.")
logger.info(
f"Processing of order number chatfilter-{id} in {processing_time}s completed."
)

return results

Expand All @@ -113,7 +116,7 @@ async def check_message():
async def check_user():
print()
start_time = time.time()
id = uuid.uuid1()
id = os.urandom(15).hex()
logger.info(f"Start processing order number user-{id}")
data = await request.get_json()
key_hash_list = load_data("json/key_hash.json")
Expand All @@ -127,7 +130,9 @@ async def check_user():

end_time = time.time()
processing_time = end_time - start_time
logger.info(f"Processing of order number user-{id} in {processing_time}s completed.")
logger.info(
f"Processing of order number user-{id} in {processing_time}s completed."
)

return result

Expand Down

0 comments on commit 04a58cb

Please sign in to comment.