mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 23:41: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
|
# Obtener el tamaño de todos los archivos y directorios (los
|
||||||
# directorios son archivos :)
|
# directorios son archivos :)
|
||||||
def size
|
def size
|
||||||
|
@size ||= begin
|
||||||
paths = [destination, File.join(destination, '**', '**')]
|
paths = [destination, File.join(destination, '**', '**')]
|
||||||
|
|
||||||
Dir.glob(paths).map do |file|
|
Dir.glob(paths).map do |file|
|
||||||
|
@ -38,6 +39,7 @@ class DeployLocal < Deploy
|
||||||
end
|
end
|
||||||
end.inject(:+)
|
end.inject(:+)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def destination
|
def destination
|
||||||
File.join(Rails.root, '_deploy', site.hostname)
|
File.join(Rails.root, '_deploy', site.hostname)
|
||||||
|
|
Loading…
Reference in a new issue