mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-22 21:01:51 +00:00
Merge branch 'deploy-reindex' into issue-10464
This commit is contained in:
commit
bf29d72301
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
|
|
@ -113,6 +113,10 @@ en:
|
||||||
title: Distributed Web
|
title: Distributed Web
|
||||||
success: Success!
|
success: Success!
|
||||||
error: Error
|
error: Error
|
||||||
|
deploy_reindex:
|
||||||
|
title: Reindex
|
||||||
|
success: Success!
|
||||||
|
error: Error
|
||||||
help: You can contact us by replying to this e-mail
|
help: You can contact us by replying to this e-mail
|
||||||
maintenance_mailer:
|
maintenance_mailer:
|
||||||
notice:
|
notice:
|
||||||
|
|
|
@ -113,6 +113,10 @@ es:
|
||||||
title: Web distribuida
|
title: Web distribuida
|
||||||
success: ¡Éxito!
|
success: ¡Éxito!
|
||||||
error: Hubo un error
|
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.
|
help: Por cualquier duda, responde este correo para contactarte con nosotres.
|
||||||
maintenance_mailer:
|
maintenance_mailer:
|
||||||
notice:
|
notice:
|
||||||
|
|
Loading…
Reference in a new issue