update ws

This commit is contained in:
MuslemRahimi 2024-10-17 16:23:51 +02:00
parent 00f225c8cd
commit 8233738671
3 changed files with 4 additions and 4 deletions

View File

@ -467,7 +467,7 @@ async def get_stock(data: TickerData, api_key: str = Security(get_api_key)):
res_json = orjson.dumps(res)
compressed_data = gzip.compress(res_json)
redis_client.set(cache_key, compressed_data)
redis_client.expire(cache_key, 60*5)
redis_client.expire(cache_key, 60*3)
return StreamingResponse(
io.BytesIO(compressed_data),

View File

@ -352,7 +352,7 @@ schedule.every(30).minutes.do(run_threaded, run_dividend_list).tag('dividend_lis
schedule.every(15).minutes.do(run_threaded, run_cron_market_news).tag('market_news_job')
schedule.every(30).minutes.do(run_threaded, run_cron_industry).tag('industry_job')
schedule.every(10).minutes.do(run_threaded, run_one_day_price).tag('one_day_price_job')
schedule.every(7).minutes.do(run_threaded, run_one_day_price).tag('one_day_price_job')
schedule.every(15).minutes.do(run_threaded, run_cron_heatmap).tag('heatmap_job')

View File

@ -201,8 +201,8 @@ fastify.register(async function (fastify) {
) {
connection.socket.send(
JSON.stringify({
bp: jsonData.bp?.toFixed(2),
ap: jsonData.ap?.toFixed(2),
bp: jsonData.bp,
ap: jsonData.ap,
lp: jsonData.lp?.toFixed(2),
type: jsonData.type,
time: formatTimestampNewYork(jsonData?.t),