From a661fddaf32599c752e69aeaf1130c927fc4d5ea Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 13 Feb 2021 06:51:29 -0600 Subject: [PATCH] fix cache cleanup for large full disks --- frigate/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/events.py b/frigate/events.py index 853828589..2430d9db3 100644 --- a/frigate/events.py +++ b/frigate/events.py @@ -113,7 +113,7 @@ class EventProcessor(threading.Thread): # if we are still using more than 90% of the cache, proactively cleanup cache_usage = shutil.disk_usage("/tmp/cache") - if cache_usage.used/cache_usage.total > .9: + if cache_usage.used/cache_usage.total > .9 and cache_usage.free < 200000000 and len(self.cached_clips) > 0: logger.warning("More than 90% of the cache is used.") logger.warning("Consider increasing space available at /tmp/cache or reducing max_seconds in your clips config.") logger.warning("Proactively cleaning up the cache...")