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