mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 21:31:42 +00:00
calcular el espacio una sola vez
This commit is contained in:
parent
ea25d27f24
commit
bb7c50e24b
1 changed files with 10 additions and 8 deletions
|
@ -28,6 +28,7 @@ class DeployLocal < Deploy
|
|||
# Obtener el tamaño de todos los archivos y directorios (los
|
||||
# directorios son archivos :)
|
||||
def size
|
||||
@size ||= begin
|
||||
paths = [destination, File.join(destination, '**', '**')]
|
||||
|
||||
Dir.glob(paths).map do |file|
|
||||
|
@ -38,6 +39,7 @@ class DeployLocal < Deploy
|
|||
end
|
||||
end.inject(:+)
|
||||
end
|
||||
end
|
||||
|
||||
def destination
|
||||
File.join(Rails.root, '_deploy', site.hostname)
|
||||
|
|
Loading…
Reference in a new issue