Combine rake tasks to save time

The log:clear task seems to take quite a bit of time. At least we can speed up a bit by only booting up Rails once.

I'm more likely to run the script if it's quick ;)
This commit is contained in:
David Cook
2023-08-09 10:28:41 +10:00
parent 9d79c7cda7
commit 91c874737a

View File

@@ -27,11 +27,8 @@ FileUtils.chdir APP_ROOT do
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Preparing database =="
system! "bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
puts "\n== Preparing database, removing old logs and tempfiles =="
system! "bin/rails db:prepare log:clear tmp:clear"
puts "\n== Restarting application server =="
# system! "bin/rails restart"