@@ -674,7 +674,7 @@ def check_folder_size(self, path):
674
674
limit_str = f"{ limit_mb } MB"
675
675
limit_bytes = limit_mb * 1024 * 1024
676
676
size = int (self ._get_dir_size (self ._get_os_path (path )))
677
- size = size * 1024 if platform .system () == "Darwin" else size
677
+ # size = size * 1024 if platform.system() == "Darwin" else size
678
678
679
679
if size > limit_bytes :
680
680
raise web .HTTPError (
@@ -690,21 +690,21 @@ def _get_dir_size(self, path="."):
690
690
calls the command line program du to get the directory size
691
691
"""
692
692
try :
693
- # result = subprocess.run(
694
- # ["du", "-s", "--block-size=1", path], capture_output=True
695
- # ).stdout.split()
696
- # self.log.info(f"current status of du command {result}")
697
- # size = result[0].decode("utf-8")
698
- if platform .system () == "Darwin" :
699
- result = subprocess .run (["du" , "-sk" , path ], capture_output = True ).stdout .split ()
700
-
701
- else :
702
- result = subprocess .run (
703
- ["du" , "-s" , "--block-size=1" , path ], capture_output = True
704
- ).stdout .split ()
705
-
693
+ result = subprocess .run (
694
+ ["du" , "-s" , "--block-size=1" , path ], capture_output = True
695
+ ).stdout .split ()
706
696
self .log .info (f"current status of du command { result } " )
707
697
size = result [0 ].decode ("utf-8" )
698
+ # if platform.system() == "Darwin":
699
+ # result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
700
+
701
+ # else:
702
+ # result = subprocess.run(
703
+ # ["du", "-s", "--block-size=1", path], capture_output=True
704
+ # ).stdout.split()
705
+
706
+ # self.log.info(f"current status of du command {result}")
707
+ # size = result[0].decode("utf-8")
708
708
except Exception as err :
709
709
self .log .error (f"Error during directory copy: { err } " )
710
710
raise web .HTTPError (
@@ -1158,7 +1158,7 @@ async def check_folder_size(self, path: str) -> None:
1158
1158
limit_str = f"{ limit_mb } MB"
1159
1159
limit_bytes = limit_mb * 1024 * 1024
1160
1160
size = int (await self ._get_dir_size (self ._get_os_path (path )))
1161
- size = size * 1024 if platform .system () == "Darwin" else size
1161
+ # size = size * 1024 if platform.system() == "Darwin" else size
1162
1162
if size > limit_bytes :
1163
1163
raise web .HTTPError (
1164
1164
400 ,
@@ -1173,17 +1173,17 @@ async def _get_dir_size(self, path: str = ".") -> str:
1173
1173
calls the command line program du to get the directory size
1174
1174
"""
1175
1175
try :
1176
- # result = subprocess.run(
1177
- # ["du", "-s", "--block-size=1", path], capture_output=True
1178
- # ).stdout.split()
1176
+ result = subprocess .run (
1177
+ ["du" , "-s" , "--block-size=1" , path ], capture_output = True
1178
+ ).stdout .split ()
1179
1179
1180
- if platform .system () == "Darwin" :
1181
- result = subprocess .run (["du" , "-sk" , path ], capture_output = True ).stdout .split ()
1180
+ # if platform.system() == "Darwin":
1181
+ # result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
1182
1182
1183
- else :
1184
- result = subprocess .run (
1185
- ["du" , "-s" , "--block-size=1" , path ], capture_output = True
1186
- ).stdout .split ()
1183
+ # else:
1184
+ # result = subprocess.run(
1185
+ # ["du", "-s", "--block-size=1", path], capture_output=True
1186
+ # ).stdout.split()
1187
1187
1188
1188
self .log .info (f"current status of du command { result } " )
1189
1189
size = result [0 ].decode ("utf-8" )
0 commit comments