Threading on Inserts Dokan
-
Hello,
It’s blocking any request on product retrievals or inserts when more than 1 thread at a time is called
- Example:
– Product retrievals are paginated, limited to 100 products at a time.
– If I multithread the product retrieval, for example call 10 calls retrieving 100 products each (1-page), to receive a total of 1000 products, we get 503 errors.
– If I call one page retrieval at a time it works, but this is too slow.
– Standard WooCommerce API call allows for this, Dokan seems thread limited
I basically figure out how many pages are required to call, then spawn off threads for each page making the call to this function. I use this exact same code successfully with WooCommerce API. I increment the page number as needed.
params = {“page”: 1, “per_page”: 100} Get first page of results
endpoint = f”{self.base_url}/wp-json/dokan/v1/stores/{self.vendor_id}/products”
results = requests.get(endpoint, headers=self.get_headers(), params=params)- Standard WooCommerce API call allows for this, Dokan seems thread limited
- Example:
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.