jef / streetmerchant

🤖 The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.97k stars 1.3k forks source link

`PAGE_SLEEP_MIN/MAX` appears to not be respected? #2316

Closed NSExceptional closed 3 years ago

NSExceptional commented 3 years ago

Expected Behavior

Lowering PAGE_SLEEP_MIN/MAX should speed up the rate at which requests are made

Current Behavior

Lowering them has no discernable effect on the rate at which requests are made

Environment

dotenv
ASCII_BANNER=
ASCII_COLOR=
APNS_AUTHKEY=
APNS_BUNDLEID=
APNS_DEVICETOKEN=
APNS_KEYID=
APNS_PRODUCTION=
APNS_TEAMID=
AUTO_ADD_TO_CART=false
BROWSER_TRUSTED=
DESKTOP_NOTIFICATIONS=true
DISCORD_NOTIFY_GROUP=
DISCORD_NOTIFY_GROUP_3060=
DISCORD_NOTIFY_GROUP_3060TI=
DISCORD_NOTIFY_GROUP_3070=
DISCORD_NOTIFY_GROUP_3080=
DISCORD_NOTIFY_GROUP_3090=
DISCORD_NOTIFY_GROUP_CORSAIR_SF=
DISCORD_NOTIFY_GROUP_RX6800=
DISCORD_NOTIFY_GROUP_RX6800XT=
DISCORD_NOTIFY_GROUP_RX6900XT=
DISCORD_NOTIFY_GROUP_RYZEN5600=
DISCORD_NOTIFY_GROUP_RYZEN5800=
DISCORD_NOTIFY_GROUP_RYZEN5900=
DISCORD_NOTIFY_GROUP_RYZEN5950=
DISCORD_NOTIFY_GROUP_SONYPS5C=
DISCORD_NOTIFY_GROUP_SONYPS5DE=
DISCORD_NOTIFY_GROUP_XBOXSX=
DISCORD_NOTIFY_GROUP_XBOXSS=
DISCORD_NOTIFY_GROUP_TEST=
DISCORD_WEB_HOOK=
EMAIL_PASSWORD=
EMAIL_TO=
EMAIL_USERNAME=
HEADLESS=
IN_STOCK_WAIT_TIME=
LOG_LEVEL=
LOW_BANDWIDTH=
MAX_PRICE_SERIES_3060=
MAX_PRICE_SERIES_3060TI=
MAX_PRICE_SERIES_3070=
MAX_PRICE_SERIES_3080=
MAX_PRICE_SERIES_3090=
MAX_PRICE_SERIES_CORSAIR_SF=
MAX_PRICE_SERIES_RX6800=
MAX_PRICE_SERIES_RX6800XT=
MAX_PRICE_SERIES_RX6900XT=
MAX_PRICE_SERIES_RYZEN5600=
MAX_PRICE_SERIES_RYZEN5800=
MAX_PRICE_SERIES_RYZEN5900=
MAX_PRICE_SERIES_RYZEN5950=
MAX_PRICE_SERIES_SONYPS5C=
MAX_PRICE_SERIES_SONYPS5DE=
MAX_PRICE_SERIES_XBOXSS=
MAX_PRICE_SERIES_XBOXSX=
MAX_PRICE_SERIES_TEST=
MICROCENTER_LOCATION=
MQTT_BROKER_ADDRESS=
MQTT_BROKER_PORT=
MQTT_CLIENT_ID=
MQTT_PASSWORD=
MQTT_QOS=
MQTT_TOPIC=
MQTT_USERNAME=
OPEN_BROWSER=
PAGE_BACKOFF_MIN=5
PAGE_BACKOFF_MAX=12
PAGE_SLEEP_MIN=5
PAGE_SLEEP_MAX=12
PAGE_TIMEOUT=
PAGERDUTY_INTEGRATION_KEY=
PAGERDUTY_SEVERITY=
PHILIPS_HUE_API_KEY=
PHILIPS_HUE_CLOUD_ACCESS_TOKEN=
PHILIPS_HUE_CLOUD_CLIENT_ID=
PHILIPS_HUE_CLOUD_CLIENT_SECRET=
PHILIPS_HUE_CLOUD_REFRESH_TOKEN=
PHILIPS_HUE_LAN_BRIDGE_IP=
PHILIPS_HUE_LIGHT_COLOR=
PHILIPS_HUE_LIGHT_IDS=
PHILIPS_HUE_LIGHT_PATTERN=
PHONE_CARRIER=
PHONE_NUMBER=
PLAY_SOUND=C:/Users/Tanner/Downloads/alert.mp3
PROXY_ADDRESS=
PROXY_PROTOCOL=
PROXY_PORT=
PUSHBULLET=
PUSHOVER_EXPIRE=
PUSHOVER_RETRY=
PUSHOVER_TOKEN=
PUSHOVER_USER=
PUSHOVER_PRIORITY=
PUSHOVER_SOUND=
RESTART_TIME=
SCREENSHOT=
SHOW_ONLY_BRANDS=nvidia,amd
SHOW_ONLY_MODELS=founders edition,5800x
SHOW_ONLY_SERIES=3060,3060ti,3070,3080
SLACK_CHANNEL=
SLACK_TOKEN=
SMARTTHINGS_TOKEN=
SMARTTHINGS_SWITCH_LABEL=
SMTP_ADDRESS=
SMTP_PORT=
STORES=bestbuy
TELEGRAM_ACCESS_TOKEN=
TELEGRAM_CHAT_ID=
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_FROM_NUMBER=
TWILIO_TO_NUMBER=
TWITCH_ACCESS_TOKEN=
TWITCH_CHANNEL=
TWITCH_CLIENT_ID=
TWITCH_CLIENT_SECRET=
TWITCH_REFRESH_TOKEN=
TWITTER_ACCESS_TOKEN_KEY=
TWITTER_ACCESS_TOKEN_SECRET=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_TWEET_TAGS=
STREAMLABS_ACCESS_TOKEN=
STREAMLABS_TYPE=
STREAMLABS_IMAGE=
STREAMLABS_SOUND=
STREAMLABS_DURATION=
WEB_PORT=
0000day commented 3 years ago

https://github.com/jef/streetmerchant/blob/113c9ce19f3ed1f140eec7cd555ec373f25d256f/src/store/model/index.ts#L374-L377

I haven't debugged it yet, but shouldnt be line 374 below 377? Saving before setting values?

0000day commented 3 years ago

Ok. After playing around with the settings I found out that if you set MIN and MAX to the same value (e.g. 2500) and only pick one store (e.g. alternate), the requests are send approx. every 6 seconds (MIN * 2 + 1 second).

I observed that with different values. I think the problem is somewhere around here https://github.com/jef/streetmerchant/blob/113c9ce19f3ed1f140eec7cd555ec373f25d256f/src/index.ts#L73-L80 and here https://github.com/jef/streetmerchant/blob/113c9ce19f3ed1f140eec7cd555ec373f25d256f/src/store/lookup.ts#L534-L550

It somehow waits twice. (Or its a visual bug with the logs?).

NSExceptional commented 3 years ago

The peculiar thing to me is I noticed exactly no difference when I used the default, and then 100/1000, then 10/50, then 5/12. They all ran at the same rate.

I think even if it is waiting twice you would notice a difference at least

bramevo commented 3 years ago

If you enable debugging mode (LOG_LEVEL=debug), you can see that it runs through all shops all the time. Maybe the run itself is slow which causes delays between checks?

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days

github-actions[bot] commented 3 years ago

This issue has been closed because it is stale. Reopen if necessary.