Fixes
This commit is contained in:
parent
c5ea92ea1f
commit
1be456ae79
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue