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 d732847b..19be03f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -111,6 +111,10 @@ en: title: Alternative domain name success: Success! error: Error + deploy_reindex: + title: Reindex + success: Success! + error: Error deploy_localized_domain: title: Domain name by language success: Success! diff --git a/config/locales/es.yml b/config/locales/es.yml index 7aab073b..36ae9a71 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -111,6 +111,10 @@ es: title: Dominio alternativo success: ¡Éxito! error: Hubo un error + deploy_reindex: + title: Reindexación + success: ¡Éxito! + error: Hubo un error deploy_localized_domain: title: Dominio según idioma success: ¡Éxito!