diff --git a/app/models/deploy_reindex.rb b/app/models/deploy_reindex.rb new file mode 100644 index 00000000..d6b2be65 --- /dev/null +++ b/app/models/deploy_reindex.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Reindexa los artículos al terminar la compilación +class DeployReindex < Deploy + def deploy + time_start + + site.reset + + 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 + + def hostname; end + + def url; end + + def destination; end +end diff --git a/app/views/deploys/_deploy_reindex.haml b/app/views/deploys/_deploy_reindex.haml new file mode 100644 index 00000000..af058968 --- /dev/null +++ b/app/views/deploys/_deploy_reindex.haml @@ -0,0 +1 @@ +-# NADA diff --git a/config/locales/en.yml b/config/locales/en.yml index a727d7c3..15ed8a78 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -113,6 +113,10 @@ en: title: Distributed Web success: Success! error: Error + deploy_reindex: + title: Reindex + success: Success! + error: Error help: You can contact us by replying to this e-mail maintenance_mailer: notice: diff --git a/config/locales/es.yml b/config/locales/es.yml index 862328e1..a190b143 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -113,6 +113,10 @@ es: title: Web distribuida success: ¡Éxito! error: Hubo un error + deploy_reindex: + title: Reindexación + success: ¡Éxito! + error: Hubo un error help: Por cualquier duda, responde este correo para contactarte con nosotres. maintenance_mailer: notice: