@@ -93,7 +93,9 @@ def list_initial_sizes(self):
93
93
self .file_index [file_path ] = size
94
94
helper .add_or_init (self .layer_index , layer_name , size )
95
95
96
- logger .debug (f"initial file: { file_path } (size: { size :,} bytes)" )
96
+ logger .debug (
97
+ f"initial file: { file_path } (size: { size :,} bytes)"
98
+ )
97
99
except OSError as e :
98
100
if log_file_accessing_err :
99
101
logger .error (f"{ e } : { file_path } " )
@@ -225,11 +227,15 @@ def check_sizes(self, layer_name: str, skip_sum_check=False):
225
227
226
228
if (
227
229
not skip_sum_check
228
- and sum (self .layer_growth_index .values ()) >= max_time_window_growth_size
230
+ and sum (self .layer_growth_index .values ())
231
+ >= max_time_window_growth_size
229
232
):
230
233
self .trigger_interval_growth_exceeded ()
231
234
232
- if not skip_sum_check and sum (self .layer_index .values ()) >= max_cache_size :
235
+ if (
236
+ not skip_sum_check
237
+ and sum (self .layer_index .values ()) >= max_cache_size
238
+ ):
233
239
self .trigger_max_cache_size ()
234
240
235
241
def trigger_layer_size_exceeded (self , layer_name : str ):
@@ -323,7 +329,13 @@ def drop(self):
323
329
324
330
325
331
def main ():
326
- global watch_dir , large_layer_size , max_cache_size , time_window , max_time_window_growth_size , log_file_accessing_err
332
+ global \
333
+ watch_dir , \
334
+ large_layer_size , \
335
+ max_cache_size , \
336
+ time_window , \
337
+ max_time_window_growth_size , \
338
+ log_file_accessing_err
327
339
328
340
default_config_path = sys .argv [1 ] if len (sys .argv ) > 1 else "default.conf"
329
341
@@ -336,7 +348,9 @@ def main():
336
348
log_file_accessing_err = True
337
349
338
350
if os .path .isfile (default_config_path ):
339
- logger .info (f"read config from { os .path .abspath (default_config_path )!r} " )
351
+ logger .info (
352
+ f"read config from { os .path .abspath (default_config_path )!r} "
353
+ )
340
354
341
355
cfg = dotenv_values (default_config_path )
342
356
@@ -362,7 +376,9 @@ def main():
362
376
)
363
377
)
364
378
logger .info (
365
- " " .join (["with `log_file_accessing_err` set to" , log_file_accessing_err ])
379
+ " " .join (
380
+ ["with `log_file_accessing_err` set to" , log_file_accessing_err ]
381
+ )
366
382
)
367
383
368
384
# init watcher
0 commit comments