From 2fac95d2e8be45eeeea51bdbadbbae71bcd27224 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 29 Mar 2023 15:06:46 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20obtener=20los=20sitios=20ordenados=20par?= =?UTF-8?q?a=20ir=20actualiz=C3=A1ndolos=20en=20orden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/cleanup_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/cleanup_service.rb b/app/services/cleanup_service.rb index 01b42d9e..b0792159 100644 --- a/app/services/cleanup_service.rb +++ b/app/services/cleanup_service.rb @@ -23,7 +23,7 @@ class CleanupService # # @return [nil] 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 Rails.logger.info "Limpiando dependencias, archivos temporales y repositorio git de #{site.name}" @@ -39,7 +39,7 @@ class CleanupService # # @return [nil] 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 Rails.logger.info "Limpiando repositorio git de #{site.name}"