fix: undefined variable in post:rebake_match

This commit is contained in:
Kyle Zhao
2017-10-24 14:49:00 -04:00
parent 5f47a4807b
commit 82c18f6ca3
2 changed files with 18 additions and 5 deletions

View File

@ -58,10 +58,12 @@ task 'posts:rebake_match', [:pattern, :type, :delay] => [:environment] do |_, ar
exit 1
end
search = Post.raw_match(pattern, type)
rebaked = 0
total = search.count
Post.raw_match(pattern, type).find_each do |post|
search.find_each do |post|
rebake_post(post)
print_status(rebaked += 1, total)
sleep(delay) if delay