mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-28 16:46:21 +00:00
38 lines
615 B
Ruby
38 lines
615 B
Ruby
# 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
|