From 6c3b2ab022b50bb15753d5acdd584f76239142d3 Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 1 Mar 2024 12:19:51 -0300 Subject: [PATCH] fix: movido metodo lfs_cleanup en cleanup_service.rb a site::repository --- app/models/site/repository.rb | 5 +++++ app/services/cleanup_service.rb | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index acbf6553..58baa5dd 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -235,5 +235,10 @@ class Site r&.success? end + + def lfs_cleanup + site.repository.git_sh("git", "lfs", "prune") + site.repository.git_sh("git", "lfs", "dedup") + end end end diff --git a/app/services/cleanup_service.rb b/app/services/cleanup_service.rb index 28f6f860..e53fbcb4 100644 --- a/app/services/cleanup_service.rb +++ b/app/services/cleanup_service.rb @@ -31,7 +31,7 @@ class CleanupService site.deploys.find_each(&:cleanup!) site.repository.gc - lfs_cleanup + site.repository.lfs_cleanup site.touch end end @@ -46,14 +46,8 @@ class CleanupService Rails.logger.info "Limpiando repositorio git de #{site.name}" site.repository.gc - lfs_cleanup + site.repository.lfs_cleanup site.touch end end - - private - def lfs_cleanup - site.repository.git_sh("git", "lfs", "prune") - site.repository.git_sh("git", "lfs", "dedup") - end end