mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
DEV: allow dev:populate
rake task in production environment. (#13777)
To use this rake task in production `ALLOW_DEV_POPULATE` environment variable should be set to "1".
This commit is contained in:
@ -30,6 +30,10 @@ module DiscourseDev
|
||||
end
|
||||
|
||||
def populate!(ignore_current_count: false)
|
||||
unless Discourse.allow_dev_populate?
|
||||
raise 'To run this rake task in a production site, set the value of `ALLOW_DEV_POPULATE` environment variable to "1"'
|
||||
end
|
||||
|
||||
unless ignore_current_count
|
||||
if current_count >= @count
|
||||
puts "Already have #{current_count} #{type} records"
|
||||
|
Reference in New Issue
Block a user