Increase scrape delay to 5-15 minutes between requests
This commit is contained in:
parent
9eb85faebd
commit
0340fc85be
1 changed files with 2 additions and 2 deletions
|
|
@ -29,9 +29,9 @@ defmodule Ammoprices.Scraping.ScrapeJob do
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
# Random delay between requests: 5-15 seconds in prod, 0 in test
|
# Random delay between requests: 5-15 minutes in prod, 0 in test
|
||||||
defp scrape_delay do
|
defp scrape_delay do
|
||||||
{min, max} = Application.get_env(:ammoprices, :scrape_delay_ms, {5_000, 15_000})
|
{min, max} = Application.get_env(:ammoprices, :scrape_delay_ms, {300_000, 900_000})
|
||||||
delay = Enum.random(min..max)
|
delay = Enum.random(min..max)
|
||||||
|
|
||||||
if delay > 0 do
|
if delay > 0 do
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue