diff --git a/src/already_posted.py b/src/already_posted.py index 1710ac5..9bb831d 100644 --- a/src/already_posted.py +++ b/src/already_posted.py @@ -1,12 +1,12 @@ import hashlib import os def already_posted(id, path): - print("Checking if posted " + id + " " + path) + print("Checking if posted " + id) res = os.listdir("/data") print(res) with open(path) as file: content = file.read().split("\n") - print("already posted " + content) + print(content) sha1 = hashlib.sha1(bytes(id, "utf-8")).hexdigest() if sha1 in content: return True diff --git a/src/main.py b/src/main.py index 5de470a..653e041 100644 --- a/src/main.py +++ b/src/main.py @@ -37,10 +37,11 @@ if verbose: print('SETTINGS' , settings) agree = [1, True, "true", "True", "yes", "Yes"] + +if (os.environ.get("USE_KUBERNETES")): + id_filename = "/data/already_posted.txt" if (os.environ.get("USE_DOCKER")): id_filename = "/app/already_posted.txt" -elif (os.environ.get("USE_KUBERNETES")): - id_filename = "/data/already_posted.txt" else: id_filename = "./already_posted.txt"