mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 18:56:21 +00:00
Merge branch 'deploy-reindex' into 'rails'
reindexar los sitios al terminar de compilarlos Closes #7530, #7529, #7528, #7527, #7512, #7511, #7510, #7509, #7494, #7493, #7492, #7491, #7408, #7407, #7406, #7405, #7397, #7396, #7395, #7394, #7383, #7382, #7381, #7380, #7170, #7169, #7168, #7167, #7154, #7153, #7152, and #7151 See merge request sutty/sutty!104
This commit is contained in:
commit
2c5a93f11b
4 changed files with 47 additions and 0 deletions
38
app/models/deploy_reindex.rb
Normal file
38
app/models/deploy_reindex.rb
Normal file
|
@ -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
|
1
app/views/deploys/_deploy_reindex.haml
Normal file
1
app/views/deploys/_deploy_reindex.haml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-# NADA
|
|
@ -111,6 +111,10 @@ en:
|
||||||
title: Alternative domain name
|
title: Alternative domain name
|
||||||
success: Success!
|
success: Success!
|
||||||
error: Error
|
error: Error
|
||||||
|
deploy_reindex:
|
||||||
|
title: Reindex
|
||||||
|
success: Success!
|
||||||
|
error: Error
|
||||||
deploy_localized_domain:
|
deploy_localized_domain:
|
||||||
title: Domain name by language
|
title: Domain name by language
|
||||||
success: Success!
|
success: Success!
|
||||||
|
|
|
@ -111,6 +111,10 @@ es:
|
||||||
title: Dominio alternativo
|
title: Dominio alternativo
|
||||||
success: ¡Éxito!
|
success: ¡Éxito!
|
||||||
error: Hubo un error
|
error: Hubo un error
|
||||||
|
deploy_reindex:
|
||||||
|
title: Reindexación
|
||||||
|
success: ¡Éxito!
|
||||||
|
error: Hubo un error
|
||||||
deploy_localized_domain:
|
deploy_localized_domain:
|
||||||
title: Dominio según idioma
|
title: Dominio según idioma
|
||||||
success: ¡Éxito!
|
success: ¡Éxito!
|
||||||
|
|
Loading…
Reference in a new issue