diff --git a/app/models/deploy_reindex.rb b/app/models/deploy_reindex.rb index 3c07023c..a280a2fc 100644 --- a/app/models/deploy_reindex.rb +++ b/app/models/deploy_reindex.rb @@ -3,12 +3,31 @@ # Reindexa los artículos al terminar la compilación class DeployReindex < Deploy def deploy(output: true) + puts 'Reindex' if output + + time_start + site.reset - site.indexed_posts.destroy_all - site.index_posts! + + Site.transaction do + site.indexed_posts.destroy_all + site.index_posts! + end + + time_stop + + build_stats.create action: 'reindex', + log: 'Reindex', + seconds: time_spent_in_seconds, + bytes: size, + status: true site.touch end + def size + 0 + end + def limit 1 end