lavolp3 / MMM-AVStock

MagicMirror module for displaying stock price with Alphavantage API
MIT License
38 stars 18 forks source link

Requests way too much for free account, do we have to pay for this service with your settings? #50

Closed ghost closed 11 months ago

ghost commented 3 years ago

the issue seems to be the way you have it throwing errors, probably figure out a way to silence them?

i might have to give up on this app and make something work with the smartweb module and a spreadsheet instead idk, this doesnt seem to be working out so far, ill leave it sit if watchdog doesnt close magicmirror constantly because it thinks avstock crashed

[2020-12-18 22:07:02.766] [ERROR]  [MMM-AVStock] ERROR: "An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency."
[2020-12-18 22:07:17.478] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.
[2020-12-18 22:07:17.488] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.
[2020-12-18 22:07:17.498] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
[2020-12-18 22:07:17.498] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
[2020-12-18 22:07:32.846] [ERROR]  [MMM-AVStock] ERROR: "An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency."
[2020-12-18 22:07:47.667] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.
[2020-12-18 22:07:47.674] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.
[2020-12-18 22:07:47.675] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
[2020-12-18 22:07:47.677] [ERROR]  (node:931) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
[1079:1218/220758.300620:FATAL:memory.cc(22)] Out of memory. size=66564096
[2020-12-18 22:08:02.514] [ERROR]  [MMM-AVStock] ERROR: "An AlphaVantage error occurred. Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency."
[2020-12-18 22:08:07.411] [ERROR]  Fri Dec 18 2020 22:08:07 GMT-0500 (Eastern Standard Time) - WatchDog: Heartbeat timeout. Frontend might have crashed. Exit now.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! magicmirror@2.13.0 start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the magicmirror@2.13.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-12-19T03_08_18_914Z-debug.log
[2020-12-18 22:08:36.336] [ERROR]  [MMM-AVStock] ERROR: "An AlphaVantage error occurred. 
lavolp3 commented 3 years ago

Of course you don't need to pay, hence the message from the API. Can you show me your config? Do you have more than one session of the mirror running? Meaning: several instances with pm2, or in a pc browser...

lavolp3 commented 3 years ago

magicmirror usually will not be rebooted because of this error. I don't know what watchdog does, never worked with that.

ghost commented 3 years ago

okay because it seems to be requesting way too much for a free account since its spamming error messages and its running forever watchdog will reset it if it misses the heartbeat because it thinks the application stopped working,

im wondering if theres some setting somewhere that you can limit the request to like once a day? because it seems to spam the server and then you hit the daily limit right away, very cool app btw, need more finance applications, love your work

lavolp3 commented 3 years ago

In your posted screenshot the error messages appear every 15 seconds. That's the interval at start of the mirror/node_helper. If your watchdog (i haven't tried any so far) restarts the mirror every time you will indeed have too many API requests. The module is set to request 500 times a day, except if the mirror is restarted several times a day. That's not how it is meant to work and that case can't be considered in the module.

I don't know why you get several error messages per 15m interval. I tried to reproduce but was not able.