From fca074bb0ec9cd78dfb02602ea94f77a79911c6b Mon Sep 17 00:00:00 2001 From: f Date: Thu, 26 Oct 2023 18:17:42 -0300 Subject: [PATCH] fix: deprecar DeployReindex ya no es necesario porque estamos reindexando a demanda (cherry picked from commit a171aa24e3aa06f781a9b38c1db985239b73f39a) --- app/models/deploy_reindex.rb | 38 ------------------- ...20231026211607_deprecate_deploy_reindex.rb | 10 +++++ 2 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 app/models/deploy_reindex.rb create mode 100644 db/migrate/20231026211607_deprecate_deploy_reindex.rb diff --git a/app/models/deploy_reindex.rb b/app/models/deploy_reindex.rb deleted file mode 100644 index f3eb3d23..00000000 --- a/app/models/deploy_reindex.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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/db/migrate/20231026211607_deprecate_deploy_reindex.rb b/db/migrate/20231026211607_deprecate_deploy_reindex.rb new file mode 100644 index 00000000..945d01b4 --- /dev/null +++ b/db/migrate/20231026211607_deprecate_deploy_reindex.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Ya no es necesario reindexar por la fuerza +class DeprecateDeployReindex < ActiveRecord::Migration[6.1] + def up + Deploy.where(type: 'DeployReindex').destroy_all + end + + def down;end +end