(20241223) Making the tick simulator live for testing.

This commit is contained in:
2024-12-23 16:48:13 +05:30
parent da138ee1b3
commit 7c7b10f27c
4 changed files with 10 additions and 18 deletions
@@ -82,7 +82,7 @@ import asyncio
# Related to Quart: # Related to Quart:
trading_oauth_callback_bp = Blueprint("trading_cb", __name__) trading_oauth_callback_bp = Blueprint("trading_oauth_cb", __name__)
# ***************************************************************************************************************** # *****************************************************************************************************************
@@ -115,7 +115,12 @@ def init(blueprint_setup_state):
async def handle_auth_exception(): async def handle_auth_exception():
print("Hi! Cleaning up...") """
Use this to handle any exceptions that occur in the process of accepting authorization details. Zero's direct
library, for instance, raise several exceptions for cases like expired tokens, checksum failures, etc.
:return: A web-view that indicates failure.
"""
return await render_template( return await render_template(
"/finstitutions/trading/oauth/oauth_failure_v2.html", "/finstitutions/trading/oauth/oauth_failure_v2.html",
client = g.client_label, client = g.client_label,
@@ -190,19 +195,6 @@ async def trading_oauth_callback(
# ┛┗┗ ┛┣┛┗┛┛┗┛┗ # ┛┗┗ ┛┣┛┗┛┛┗┛┗
# ┛ # ┛
# # No valid client:
# if success is None: return ResponseModel(
# status_code = StatusCodes.FAILED,
# http_code = HttpCodes.BAD_REQUEST,
# message = f"Invalid/unimplemented client '{trading_client}'."
# )
#
# # When the client was valid:
# return ResponseModel(
# status_code = StatusCodes.OK if success else StatusCodes.FAILED,
# http_code = HttpCodes.SUCCESS if success else HttpCodes.INTERNAL_SERVER_ERROR,
# )
# No valid client: # No valid client:
if success is None: return await render_template( if success is None: return await render_template(
"/finstitutions/trading/oauth/oauth_failure_v2.html", "/finstitutions/trading/oauth/oauth_failure_v2.html",
+1 -1
View File
@@ -3,7 +3,7 @@
# Kill all the scripts: # Kill all the scripts:
echo "Killing the script." echo "Killing the script."
pkill -9 -f "$(pwd)/api/main.py" pkill -9 -f "$(pwd)/api/main.py"
pkill -9 -f "$(pwd)/wsocket/main.py" pkill -9 -f "$(pwd)/playground/socketio/tick_simulator.py"
# Get the name of the current directory, # Get the name of the current directory,
# and kill the monitors of the above scripts: # and kill the monitors of the above scripts:
+1 -1
View File
@@ -338,7 +338,7 @@ if __name__ == "__main__":
# Run the web server # Run the web server
runner = web.AppRunner(app) runner = web.AppRunner(app)
await runner.setup() await runner.setup()
site = web.TCPSite(runner, "0.0.0.0", 5000) site = web.TCPSite(runner, "0.0.0.0", 5214)
print("Server running on http://0.0.0.0:5000") print("Server running on http://0.0.0.0:5000")
await site.start() await site.start()
+1 -1
View File
@@ -3,7 +3,7 @@
# Use this to run the microservice without any docker setup. # Use this to run the microservice without any docker setup.
source .venv/bin/activate source .venv/bin/activate
python3 "$(pwd)/api/main.py" --host "0.0.0.0" --port 5106 --workers 4 --script-id "kps_cnv_KBC3MoaU" & python3 "$(pwd)/api/main.py" --host "0.0.0.0" --port 5106 --workers 4 --script-id "kps_cnv_KBC3MoaU" &
python3 "$(pwd)/wsocket/main.py" & python3 "$(pwd)/playground/socketio/tick_simulator.py" &
deactivate deactivate
# All done: # All done: