FIX: Don't run a `FULL ANALYZE` on first migration.
This seems to block databases unecessarily. We should only really be vacuuming when there is a lot of deleted data to recover.
This commit is contained in:
parent
b46663fab0
commit
57fc1e5e0c
|
@ -7,6 +7,8 @@ end
|
|||
task 'db:migrate' => ['environment', 'set_locale'] do
|
||||
SeedFu.seed
|
||||
|
||||
SiteSetting.last_vacuum = Time.now.to_i if SiteSetting.last_vacuum == 0
|
||||
|
||||
if SiteSetting.vacuum_db_days > 0 &&
|
||||
SiteSetting.last_vacuum < (Time.now.to_i - SiteSetting.vacuum_db_days.days.to_i)
|
||||
puts "Running VACUUM FULL ANALYZE to reclaim DB space, this may take a while"
|
||||
|
|
Loading…
Reference in New Issue