From 10e9b33a99efe78872ce5c0f4d159edf10892032 Mon Sep 17 00:00:00 2001 From: Haitem Date: Mon, 30 Dec 2024 14:48:00 +0100 Subject: [PATCH 1/2] =?UTF-8?q?#PK-163=20-=20Kontrolovat=20m=C3=ADsto=20p?= =?UTF-8?q?=C5=99i=20anonymizaci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repair function on check size on disc --- app.py | 8 ++++---- requirements.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index e956bbd..b9e8bfb 100644 --- a/app.py +++ b/app.py @@ -10,11 +10,10 @@ from retinaface import RetinaFace treashold = float(os.getenv('FACE_TRASHOLD', '0.9')) sever = os.getenv('API_ROOT', 'localhost:8000') -disk_treashold = os.getenv('DISK_FREE_TRASHOLD', 'localhost:8000') +disk_treashold = os.getenv('DISK_FREE_TRASHOLD', 10) root_api_url = 'http://{}/local'.format(sever) -base_path = '/app/data/' -total, used, free = shutil.disk_usage(base_path) +base_path = 'C:/Git/LAR_CK/storage/app/' print("API_ROOT: " + str(root_api_url), flush=True) print("FACE_TRASHOLD: " + str(treashold), flush=True) @@ -26,7 +25,8 @@ try: #Chesk if there is enought free space at destination path while True: - if (free // (2**30)) > 10: + total, used, free = shutil.disk_usage(base_path) + if (free // (2**30)) > ((total / 100) * disk_treashold) // (2**30): break data = {"trace": "not enought free space at destination" + str(base_path) + " trashold is: " + str(disk_treashold) + "%"} diff --git a/requirements.txt b/requirements.txt index 067e002..49a7be0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ opencv-python +requests numpy requests retina-face From 1d3a752df1cba84d887e899632608391d360a447 Mon Sep 17 00:00:00 2001 From: Haitem Date: Mon, 30 Dec 2024 14:52:02 +0100 Subject: [PATCH 2/2] =?UTF-8?q?#PK-163=20-=20Kontrolovat=20m=C3=ADsto=20p?= =?UTF-8?q?=C5=99i=20anonymizaci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix edit path --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index b9e8bfb..40be8df 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,7 @@ sever = os.getenv('API_ROOT', 'localhost:8000') disk_treashold = os.getenv('DISK_FREE_TRASHOLD', 10) root_api_url = 'http://{}/local'.format(sever) -base_path = 'C:/Git/LAR_CK/storage/app/' +base_path = '/app/data/' print("API_ROOT: " + str(root_api_url), flush=True) print("FACE_TRASHOLD: " + str(treashold), flush=True)