From 5f43e5a6588a190062d03fd341eddc27ac0af8ef Mon Sep 17 00:00:00 2001
From: Cristiano Urban <cristiano.urban@inaf.it>
Date: Fri, 2 Feb 2024 14:53:24 +0100
Subject: [PATCH] Exclude entries in 'deleted_node' table having 'os_rel_path'
 = NULL due to deletion of a copied node (see DbConnector and FileCleaner
 classes).

Signed-off-by: Cristiano Urban <cristiano.urban@inaf.it>
---
 transfer_service/db_connector.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/transfer_service/db_connector.py b/transfer_service/db_connector.py
index debb493..179dfcf 100644
--- a/transfer_service/db_connector.py
+++ b/transfer_service/db_connector.py
@@ -276,7 +276,8 @@ class DbConnector(object):
                 SELECT base_path as os_base_path, '/' || fs_path AS os_rel_path, deleted_on, d.node_id
                 FROM deleted_node d
                 JOIN location l ON d.location_id = l.location_id
-                JOIN storage s ON s.storage_id = l.storage_src_id;
+                JOIN storage s ON s.storage_id = l.storage_src_id
+                WHERE fs_path is NOT NULL;
                 """)
             result = cursor.fetchall()
             cursor.close()
-- 
GitLab