mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
fix tmpfs
This commit is contained in:
parent
961997e078
commit
9f504253fb
@ -38,19 +38,19 @@ class FrigateApp():
|
|||||||
self.camera_metrics = {}
|
self.camera_metrics = {}
|
||||||
|
|
||||||
def ensure_dirs(self):
|
def ensure_dirs(self):
|
||||||
tmpfs_size = self.config.save_clips.tmpfs_cache_size
|
|
||||||
if tmpfs_size:
|
|
||||||
logger.info(f"Creating tmpfs of size {tmpfs_size}")
|
|
||||||
rc = os.system(f"mount -t tmpfs -o size={tmpfs_size} tmpfs {CACHE_DIR}")
|
|
||||||
if rc != 0:
|
|
||||||
logger.error(f"Failed to create tmpfs, error code: {rc}")
|
|
||||||
|
|
||||||
for d in [RECORD_DIR, CLIPS_DIR, CACHE_DIR]:
|
for d in [RECORD_DIR, CLIPS_DIR, CACHE_DIR]:
|
||||||
if not os.path.exists(d) and not os.path.islink(d):
|
if not os.path.exists(d) and not os.path.islink(d):
|
||||||
logger.info(f"Creating directory: {d}")
|
logger.info(f"Creating directory: {d}")
|
||||||
os.makedirs(d)
|
os.makedirs(d)
|
||||||
else:
|
else:
|
||||||
logger.debug(f"Skipping directory: {d}")
|
logger.debug(f"Skipping directory: {d}")
|
||||||
|
|
||||||
|
tmpfs_size = self.config.save_clips.tmpfs_cache_size
|
||||||
|
if tmpfs_size:
|
||||||
|
logger.info(f"Creating tmpfs of size {tmpfs_size}")
|
||||||
|
rc = os.system(f"mount -t tmpfs -o size={tmpfs_size} tmpfs {CACHE_DIR}")
|
||||||
|
if rc != 0:
|
||||||
|
logger.error(f"Failed to create tmpfs, error code: {rc}")
|
||||||
|
|
||||||
def init_logger(self):
|
def init_logger(self):
|
||||||
self.log_process = mp.Process(target=log_process, args=(self.log_queue,), name='log_process')
|
self.log_process = mp.Process(target=log_process, args=(self.log_queue,), name='log_process')
|
||||||
|
Loading…
Reference in New Issue
Block a user