mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Disable SearchIndexer after fabrication (#21378)
SearchIndexer is only automatically disabled in `before_all` and `before` blocks which means at the start of test runs. Enabling the SearchIndexer in one `fab!` block will affect all other `fab!` blocks which is not ideal as we may be indexing stuff for search when we don't need to.
This commit is contained in:
committed by
GitHub
parent
9a3257cb33
commit
afc1611be7
@@ -202,4 +202,11 @@ module Helpers
|
||||
ips.map { |ip| Addrinfo.new([IPAddr.new(ip).ipv6? ? "AF_INET6" : "AF_INET", 80, nil, ip]) },
|
||||
)
|
||||
end
|
||||
|
||||
def with_search_indexer_enabled
|
||||
SearchIndexer.enable
|
||||
yield
|
||||
ensure
|
||||
SearchIndexer.disable
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user