Increase scrape delay to 5-15 minutes between requests

This commit is contained in:
Graham McIntire 2026-03-12 10:06:43 -05:00
parent 9eb85faebd
commit 0340fc85be
No known key found for this signature in database

View file

@ -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