5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 11:06:08 +00:00
panel/app/models/deploy_reindex.rb

41 lines
655 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
# Reindexa los artículos al terminar la compilación
class DeployReindex < Deploy
2022-07-26 16:57:57 +00:00
def deploy(output: true)
puts 'Reindex' if output
2022-07-26 17:13:54 +00:00
time_start
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
site.touch
end
2022-07-26 17:13:54 +00:00
def size
0
end
def limit
1
end
def hostname; end
2022-07-26 17:50:46 +00:00
def url; end
def destination; end
end