-
Notifications
You must be signed in to change notification settings - Fork 1
Cron Job
Jonathan Langlois edited this page Mar 26, 2020
·
1 revision
We need to update DB every 24 hours. Process:
- Update stocks by running the runStockQueries function in seedStockHistories.js
- Update cryptos by running the runCryptoQueries function in seedCryptoHistories.js
- Update portfolio values by running updatePortfolios function in updatePortfolios.js
- Add new values to portfolio_histories by running updatePortfolioHistories function in update_portfolio_histories.js
That's all. The update stocks and cryptos functions both take a while (timeouts used since we are using the free API version and have limited calls per minute). They also can't be run concurrently for the same reason. Going through this now I notice the file names are inconsistent, and in some of the files the functions are being called at the end, and in others, they are exported. This can be made consistent as well