From c29bd05f3b4f0a1f0c0dc368ef6a893ff044799d Mon Sep 17 00:00:00 2001 From: Neil Carpenter Date: Mon, 5 Dec 2022 07:32:27 -0500 Subject: [PATCH] PVC debugging --- src/already_posted.py | 7 +++++++ src/main.py | 1 + 2 files changed, 8 insertions(+) diff --git a/src/already_posted.py b/src/already_posted.py index 923fd71..1710ac5 100644 --- a/src/already_posted.py +++ b/src/already_posted.py @@ -1,14 +1,21 @@ import hashlib +import os def already_posted(id, path): + print("Checking if posted " + id + " " + path) + res = os.listdir("/data") + print(res) with open(path) as file: content = file.read().split("\n") + print("already posted " + content) sha1 = hashlib.sha1(bytes(id, "utf-8")).hexdigest() if sha1 in content: return True return False def mark_as_posted(id, path): + print("Adding " + id + " " + path) with open(path, 'a') as file: sha1 = hashlib.sha1(bytes(id, "utf-8")).hexdigest() file.write(sha1+'\n') + print(file.read()) diff --git a/src/main.py b/src/main.py index f8000ca..5de470a 100644 --- a/src/main.py +++ b/src/main.py @@ -44,6 +44,7 @@ elif (os.environ.get("USE_KUBERNETES")): else: id_filename = "./already_posted.txt" +print(id_filename) with open(id_filename, "a") as f: f.write("\n")