forked from e621ng/e621ng
[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:
parent
82d7ff59e0
commit
d13dc9cad4
@ -19,7 +19,7 @@ To mitigate this you can install a WSL distribution and clone the project inside
|
|||||||
3. `cd` into the repo.
|
3. `cd` into the repo.
|
||||||
4. Run the following commands:
|
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
|
docker-compose up
|
||||||
```
|
```
|
||||||
After running the commands once only `docker-compose up` is needed to bring up the containers.
|
After running the commands once only `docker-compose up` is needed to bring up the containers.
|
||||||
|
@ -46,7 +46,7 @@ unless Rails.env.test?
|
|||||||
CurrentUser.ip_addr = "127.0.0.1"
|
CurrentUser.ip_addr = "127.0.0.1"
|
||||||
|
|
||||||
resources = YAML.load_file Rails.root.join("db", "seeds.yml")
|
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, {
|
response = HTTParty.get(url, {
|
||||||
headers: {"User-Agent" => "e621ng/seeding"}
|
headers: {"User-Agent" => "e621ng/seeding"}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user