replace 1000000 to 2^20

This commit is contained in:
Sergey Krashevich 2023-06-11 17:55:00 +03:00
parent 0435bee3da
commit 5116f92c21
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
3 changed files with 3 additions and 3 deletions

View File

@ -429,7 +429,7 @@ class FrigateApp:
self.frigate_watchdog.start()
def check_shm(self) -> None:
available_shm = round(shutil.disk_usage("/dev/shm").total / 1000000, 1)
available_shm = round(shutil.disk_usage("/dev/shm").total / pow(2, 20), 1)
min_req_shm = 30
for _, camera in self.config.cameras.items():

View File

@ -326,7 +326,7 @@ class RecordingMaintainer(threading.Thread):
# get the segment size of the cache file
# file without faststart is same size
segment_size = round(
float(os.path.getsize(cache_path)) / 1000000, 1
float(os.path.getsize(cache_path)) / pow(2, 20), 1
)
except OSError:
segment_size = 0

View File

@ -85,7 +85,7 @@ class StorageMaintainer(threading.Thread):
hourly_bandwidth = sum(
[b["bandwidth"] for b in self.camera_storage_stats.values()]
)
remaining_storage = round(shutil.disk_usage(RECORD_DIR).free / 1000000, 1)
remaining_storage = round(shutil.disk_usage(RECORD_DIR).free / pow(2, 20), 1)
logger.debug(
f"Storage cleanup check: {hourly_bandwidth} hourly with remaining storage: {remaining_storage}."
)