[Docker] Set the posts to seed amount through env

Most of the time I don't need 100, especially when I'm `down -v` constantly.
This is a switch to easily lower that.
This commit is contained in:
Earlopain 2022-01-05 13:44:36 +01:00
parent 82d7ff59e0
commit d13dc9cad4
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ To mitigate this you can install a WSL distribution and clone the project inside
3. `cd` into the repo.
4. Run the following commands:
```
docker-compose run -e DANBOORU_DISABLE_THROTTLES=true e621 /app/bin/setup
docker-compose run -e DANBOORU_DISABLE_THROTTLES=true -e SEED_POST_COUNT=100 e621 /app/bin/setup
docker-compose up
```
After running the commands once only `docker-compose up` is needed to bring up the containers.

View File

@ -46,7 +46,7 @@ unless Rails.env.test?
CurrentUser.ip_addr = "127.0.0.1"
resources = YAML.load_file Rails.root.join("db", "seeds.yml")
url = "https://e621.net/posts.json?limit=100&tags=id:" + resources["post_ids"].join(",")
url = "https://e621.net/posts.json?limit=#{ENV.fetch("SEED_POST_COUNT", 100)}&tags=id:#{resources["post_ids"].join(",")}"
response = HTTParty.get(url, {
headers: {"User-Agent" => "e621ng/seeding"}
})