forked from e621ng/e621ng
[Docker] Tentative fix for intermittent CI test failures
Elastic indicies aren't ready sometimes. I don't know where they are created, but it seems to be too late. Move creation into the seeds file and execute it in all environments. Calling create_index! multiple times is fine, this is important because the seeds file should be idempotent
This commit is contained in:
parent
4bc3f744b4
commit
f722dbb4c3
@ -24,12 +24,6 @@ FileUtils.chdir APP_ROOT do
|
||||
system! 'RAILS_ENV=development bin/rails db:schema:load'
|
||||
system! 'RAILS_ENV=development DANBOORU_DISABLE_THROTTLES=true bin/rails db:seed'
|
||||
|
||||
puts "\n== Preparing search indices =="
|
||||
system! 'bin/rails r Post.__elasticsearch__.create_index!'
|
||||
system! 'bin/rails r Post.import'
|
||||
system! 'bin/rails r PostVersion.__elasticsearch__.create_index!'
|
||||
system! 'bin/rails r PostVersion.import'
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system! 'bin/rails log:clear tmp:clear'
|
||||
end
|
||||
|
@ -4,11 +4,9 @@ require "digest/md5"
|
||||
require "net/http"
|
||||
require "tempfile"
|
||||
|
||||
unless Rails.env.test?
|
||||
puts "== Creating elasticsearch indices ==\n"
|
||||
|
||||
Post.__elasticsearch__.create_index!
|
||||
end
|
||||
puts "== Creating elasticsearch indices ==\n"
|
||||
Post.__elasticsearch__.create_index!
|
||||
PostVersion.__elasticsearch__.create_index!
|
||||
|
||||
puts "== Seeding database with sample content ==\n"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user