Streetmerchant: Is my IN_STOCK_WAIT_TIME working properly?

Created on 23 Nov 2020  ยท  7Comments  ยท  Source: jef/streetmerchant

Description

Hello everyone,

I have set the IN_STOCK_WAIT_TIME="60" in the .env file expecting that the script will wait for 60 seconds before it checks again if a certain model-brand-site is in stock. But let me show you the output of my PowerShell:

[22:14:17] info :: โœ– [zotac] [zotac (3080)] trinity oc :: OUT OF STOCK
[22:14:18] info :: โœ– [amazon] [asus (3080)] strix oc :: OUT OF STOCK
[22:14:19] info :: โœ– [newegg] [gigabyte (3080)] vision oc :: OUT OF STOCK
[22:14:19] info :: โœ– [pny] [pny (3080)] xlr8 revel :: OUT OF STOCK
[22:14:19] info :: โœ– [amazon] [msi (3080)] ventus 3x oc :: OUT OF STOCK
[22:14:20] info :: โœ– [amazon] [zotac (3080)] trinity :: OUT OF STOCK
[22:14:24] info :: โœ– [pny] [pny (3080)] xlr8 revel :: OUT OF STOCK
[22:14:27] info :: โœ– [amazon] [pny (3080)] xlr8 revel :: OUT OF STOCK
[22:14:28] info :: โœ– [newegg] [asus (3080)] tuf :: OUT OF STOCK
[22:14:28] info :: โœ– [amazon] [pny (3080)] xlr8 revel :: OUT OF STOCK
[22:14:29] info :: โœ– [amazon] [msi (3080)] gaming x trio :: OUT OF STOCK
[22:14:29] info :: โœ– [zotac] [zotac (3080)] trinity :: OUT OF STOCK
[22:14:30] info :: โœ– [amazon] [evga (3080)] ftw3 ultra :: OUT OF STOCK
[22:14:31] info :: โœ– [amazon] [evga (3080)] xc3 ultra :: OUT OF STOCK
[22:14:32] info :: โœ– [amazon] [evga (3080)] ftw3 :: OUT OF STOCK
[22:14:32] info :: โœ– [newegg] [evga (3080)] ftw3 ultra :: OUT OF STOCK
[22:14:33] info :: โœ– [amazon] [evga (3080)] xc3 :: OUT OF STOCK
[22:14:33] info :: โœ– [amazon] [evga (3080)] xc3 black :: OUT OF STOCK
[22:14:34] info :: โœ– [zotac] [zotac (3080)] trinity oc :: OUT OF STOCK

In the above example the script waits only 17 seconds to ask again to Zotac website for the 3080 Trinity OC. Is that normal behavior or am I reading it wrong or that option setting does not what I'm expecting it to do?

Most helpful comment

@jiglesiasc yes you are wrong. The "IN_STOCK_WAIT_TIME" only applies when an item is IN STOCK. If you want to adjust the overall interval there is a place to do it in the config (see stores #2). You basically set the page_sleep_min and page_sleep_max for each store.

Example from readme file: | STORES | Supported stores you want to be scraped | Both supported formats are comma separated

  1. Standard E.g.: "nvidia"

  2. Advanced E.g: STORE:PAGE_SLEEP_MIN:PAGE_SLEEP_MAX, E.g: nvidia:10000:30000

Default: nvidia |

Thank you very much, that works pretty well. Now my CPU can take a break, lol

All 7 comments

Those items are out of stock.

Yeah I know those items are out of stock. What I am trying to determine is if the IN_STOCK_WAIT_TIME setting is working correctly as I understand that parameter defines how often the script asks to a website for a specific video card model, and I set that time to 60 seconds but according to what I've observed that time is not being respected.

I do want to set the consulting time to 60 seconds for several reasons, but the main one is to not get banned of every site. Secondary reasons are CPU usage, and bandwidth consumption.

https://i.imgur.com/kvOUIQD.png
Please read the readme.

https://i.imgur.com/kvOUIQD.png
Please read the readme.

Yeah I already read that, but what I understand from that description is that the script for example should wait for IN_STOCK_WAIT_TIME "seconds" before consulting again the same link. In the case above the link for the Zotac 3080 trinity OC from the Zotac website should be consulted in intervals of IN_STOCK_WAIT_TIME seconds. Am I wrong?

@jiglesiasc yes you are wrong. The "IN_STOCK_WAIT_TIME" only applies when an item is IN STOCK. If you want to adjust the overall interval there is a place to do it in the config (see stores #2). You basically set the page_sleep_min and page_sleep_max for each store.

Example from readme file: | STORES | Supported stores you want to be scraped | Both supported formats are comma separated

1. Standard E.g.: "nvidia"

2. Advanced E.g: STORE:PAGE_SLEEP_MIN:PAGE_SLEEP_MAX, E.g: nvidia:10000:30000

Default: nvidia |

@jiglesiasc yes you are wrong. The "IN_STOCK_WAIT_TIME" only applies when an item is IN STOCK. If you want to adjust the overall interval there is a place to do it in the config (see stores #2). You basically set the page_sleep_min and page_sleep_max for each store.

Example from readme file: | STORES | Supported stores you want to be scraped | Both supported formats are comma separated

  1. Standard E.g.: "nvidia"

  2. Advanced E.g: STORE:PAGE_SLEEP_MIN:PAGE_SLEEP_MAX, E.g: nvidia:10000:30000

Default: nvidia |

Thank you very much, that works pretty well. Now my CPU can take a break, lol

Thanks everyone for the help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scot-onet picture scot-onet  ยท  4Comments

g1forfun picture g1forfun  ยท  5Comments

mhenry84 picture mhenry84  ยท  3Comments

dochodges picture dochodges  ยท  5Comments

FawnPat picture FawnPat  ยท  4Comments