Long running scripts won't keep information for a given ticker up to date because data is cached on first request
Closed this issue · 3 comments
DBids35 commented
Long running scripts won't keep information for a given ticker up to date because data is cached on first request
unreal79 commented
I confirm the problem. Looks like it's somewhere in file request_functions.py
. There are a lot of connection related stuff there (aiohttp, requests, tenacity, urllib), so I'm not sure, but my guess is: function http_request_get
should be changed to:
headers={"User-Agent": user_agent, "Cache-Control": "no-cache", "Pragma": "no-cache"},
d3an commented
Can someone create a PR?
unreal79 commented
Tested the "Cache-Control": "no-cache", "Pragma": "no-cache"
thing. It doesn't help much. (Actually I added "Cache-Control": "no-cache", "Pragma": "no-cache"
everywhere I could find.)
"Solved" the issue by automatically restarting my script via systemctl
every day.