git
This commit is contained in:
@@ -63,7 +63,7 @@ def compute_blake3(path: Path) -> bytes:
|
|||||||
def hash_in_db(cursor, digest: bytes):
|
def hash_in_db(cursor, digest: bytes):
|
||||||
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%' LIMIT 1",
|
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%%' LIMIT 1",
|
||||||
(digest,)
|
(digest,)
|
||||||
)
|
)
|
||||||
return cursor.fetchone() # None nebo (host_name, full_path)
|
return cursor.fetchone() # None nebo (host_name, full_path)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ DB_CONFIG = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CHUNK_SIZE = 8 * 1024 * 1024 # 8 MB
|
CHUNK_SIZE = 8 * 1024 * 1024 # 8 MB
|
||||||
DRY_RUN = False # True = pouze vypíše, nesmaže
|
DRY_RUN = True # True = pouze vypíše, nesmaže
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# HELPERS
|
# HELPERS
|
||||||
@@ -63,7 +63,7 @@ def compute_blake3(path: Path) -> bytes:
|
|||||||
def hash_in_db(cursor, digest: bytes):
|
def hash_in_db(cursor, digest: bytes):
|
||||||
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%' LIMIT 1",
|
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%%' LIMIT 1",
|
||||||
(digest,)
|
(digest,)
|
||||||
)
|
)
|
||||||
return cursor.fetchone() # None nebo (host_name, full_path)
|
return cursor.fetchone() # None nebo (host_name, full_path)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ def compute_blake3(path: Path) -> bytes:
|
|||||||
def hash_in_db(cursor, digest: bytes):
|
def hash_in_db(cursor, digest: bytes):
|
||||||
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
"""Vrátí (host_name, full_path) prvního záznamu s daným hashem, nebo None."""
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%' LIMIT 1",
|
"SELECT host_name, full_path FROM file_md5_index WHERE blake3 = %s AND host_name = 'tower1' AND full_path LIKE '/mnt/user/#ColdData/Porno/%%' LIMIT 1",
|
||||||
(digest,)
|
(digest,)
|
||||||
)
|
)
|
||||||
return cursor.fetchone() # None nebo (host_name, full_path)
|
return cursor.fetchone() # None nebo (host_name, full_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user