mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 11:16:23 +00:00
Merge branch 'deploy-reindex' into panel.sutty.nl
This commit is contained in:
commit
016b5e7ef8
1 changed files with 21 additions and 2 deletions
|
@ -3,12 +3,31 @@
|
||||||
# Reindexa los artículos al terminar la compilación
|
# Reindexa los artículos al terminar la compilación
|
||||||
class DeployReindex < Deploy
|
class DeployReindex < Deploy
|
||||||
def deploy(output: true)
|
def deploy(output: true)
|
||||||
|
puts 'Reindex' if output
|
||||||
|
|
||||||
|
time_start
|
||||||
|
|
||||||
site.reset
|
site.reset
|
||||||
|
|
||||||
|
Site.transaction do
|
||||||
site.indexed_posts.destroy_all
|
site.indexed_posts.destroy_all
|
||||||
site.index_posts!
|
site.index_posts!
|
||||||
|
end
|
||||||
|
|
||||||
|
time_stop
|
||||||
|
|
||||||
|
build_stats.create action: 'reindex',
|
||||||
|
log: 'Reindex',
|
||||||
|
seconds: time_spent_in_seconds,
|
||||||
|
bytes: size,
|
||||||
|
status: true
|
||||||
site.touch
|
site.touch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def size
|
||||||
|
0
|
||||||
|
end
|
||||||
|
|
||||||
def limit
|
def limit
|
||||||
1
|
1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue