From 6c3b2ab022b50bb15753d5acdd584f76239142d3 Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 1 Mar 2024 12:19:51 -0300 Subject: [PATCH 1/2] 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 From 291c477aec286e4cbefca321604c91cdf428c65a Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 1 Mar 2024 13:11:04 -0300 Subject: [PATCH 2/2] fix: corregido metodo lfs_cleanup --- app/models/site/repository.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index 58baa5dd..687ced12 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -237,8 +237,8 @@ class Site end def lfs_cleanup - site.repository.git_sh("git", "lfs", "prune") - site.repository.git_sh("git", "lfs", "dedup") + git_sh("git", "lfs", "prune") + git_sh("git", "lfs", "dedup") end end end