Merge branch 'main' of github.com:yuzhiyongcn/real_trader
This commit is contained in:
commit
7d244f453b
@ -75,11 +75,6 @@ trader.login()
|
|||||||
|
|
||||||
# 添加请求频率限制
|
# 添加请求频率限制
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
limiter = Limiter(
|
|
||||||
app=app,
|
|
||||||
key_func=get_remote_address,
|
|
||||||
default_limits=[f"{Config.RATE_LIMIT_REQUESTS} per {Config.RATE_LIMIT_PERIOD} seconds"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# 使用配置文件中的时间
|
# 使用配置文件中的时间
|
||||||
run_daily(Config.MARKET_OPEN_TIME, lambda: trader.login())
|
run_daily(Config.MARKET_OPEN_TIME, lambda: trader.login())
|
||||||
@ -185,6 +180,7 @@ def get_balance():
|
|||||||
response = {"success": True, "data": balance}
|
response = {"success": True, "data": balance}
|
||||||
return jsonify(response), 200
|
return jsonify(response), 200
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
logger.error(f"Error processing balance request: {str(e)}")
|
logger.error(f"Error processing balance request: {str(e)}")
|
||||||
abort(500, description="Internal server error")
|
abort(500, description="Internal server error")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user