2022-07-26 16:49:59 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Reindexa los artículos al terminar la compilación
|
|
|
|
class DeployReindex < Deploy
|
|
|
|
def deploy
|
2022-07-26 17:13:54 +00:00
|
|
|
time_start
|
|
|
|
|
2022-07-26 16:49:59 +00:00
|
|
|
site.reset
|
2022-07-26 17:13:54 +00:00
|
|
|
|
|
|
|
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
|
2022-07-26 16:49:59 +00:00
|
|
|
site.touch
|
|
|
|
end
|
|
|
|
|
2022-07-26 17:13:54 +00:00
|
|
|
def size
|
|
|
|
0
|
|
|
|
end
|
|
|
|
|
2022-07-26 16:49:59 +00:00
|
|
|
def limit
|
|
|
|
1
|
|
|
|
end
|
|
|
|
|
2022-08-03 16:23:03 +00:00
|
|
|
def hostname; end
|
2022-07-26 17:50:46 +00:00
|
|
|
|
2022-08-03 16:23:03 +00:00
|
|
|
def url; end
|
|
|
|
|
|
|
|
def destination; end
|
2022-07-26 16:49:59 +00:00
|
|
|
end
|