5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 05:41:41 +00:00

fix: obtener los sitios ordenados para ir actualizándolos en orden

This commit is contained in:
f 2023-03-29 15:06:46 -03:00
parent d99f02bd0c
commit 2fac95d2e8

View file

@ -23,7 +23,7 @@ class CleanupService
# #
# @return [nil] # @return [nil]
def cleanup_older_sites! def cleanup_older_sites!
Site.where('updated_at < ?', before).find_each do |site| Site.where('updated_at < ?', before).order(updated_at: :desc).find_each do |site|
next unless File.directory? site.path next unless File.directory? site.path
Rails.logger.info "Limpiando dependencias, archivos temporales y repositorio git de #{site.name}" Rails.logger.info "Limpiando dependencias, archivos temporales y repositorio git de #{site.name}"
@ -39,7 +39,7 @@ class CleanupService
# #
# @return [nil] # @return [nil]
def cleanup_newer_sites! def cleanup_newer_sites!
Site.where('updated_at >= ?', before).find_each do |site| Site.where('updated_at >= ?', before).order(updated_at: :desc).find_each do |site|
next unless File.directory? site.path next unless File.directory? site.path
Rails.logger.info "Limpiando repositorio git de #{site.name}" Rails.logger.info "Limpiando repositorio git de #{site.name}"