jingedawang / StockPredictor

Predict the stock price with AI models.
http://stockprediction.org/
MIT License
20 stars 6 forks source link

Will the database update reflect to frontend immediately? #77

Closed jingedawang closed 1 year ago

jingedawang commented 1 year ago

It should be. But recently the update didn't show up until I re-start the app. It's a little weird.

jingedawang commented 1 year ago

I guess it's because the TinyDB cache. Simply disable the cache for a while. When users become more and more, this shouldn't be a problem anymore.

jingedawang commented 1 year ago

It's strange that looks like disabling cache didn't work. But not sure. Need to confirm next week.

jingedawang commented 1 year ago

According to the official document: https://tinydb.readthedocs.io/en/latest/usage.html#query-caching Disabling cache should work.

jingedawang commented 1 year ago

Yes, it didn't work. Don't know why.

jingedawang commented 1 year ago

After debugging into TinyDB, it shows that TinyDB is working correctly. Looks like it's due to the qlib data cache. So I added a refresh mechanism to solve this problem. Let's see whether it works in next trading day.

jingedawang commented 1 year ago

Great! This PR perfectly sovled this problem. It's indeed due to qlib data cache.