Fixes
This commit is contained in:
parent
c5ea92ea1f
commit
1be456ae79
|
@ -1,12 +1,12 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
def already_posted(id, path):
|
def already_posted(id, path):
|
||||||
print("Checking if posted " + id + " " + path)
|
print("Checking if posted " + id)
|
||||||
res = os.listdir("/data")
|
res = os.listdir("/data")
|
||||||
print(res)
|
print(res)
|
||||||
with open(path) as file:
|
with open(path) as file:
|
||||||
content = file.read().split("\n")
|
content = file.read().split("\n")
|
||||||
print("already posted " + content)
|
print(content)
|
||||||
sha1 = hashlib.sha1(bytes(id, "utf-8")).hexdigest()
|
sha1 = hashlib.sha1(bytes(id, "utf-8")).hexdigest()
|
||||||
if sha1 in content:
|
if sha1 in content:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -37,10 +37,11 @@ if verbose:
|
||||||
print('SETTINGS' , settings)
|
print('SETTINGS' , settings)
|
||||||
|
|
||||||
agree = [1, True, "true", "True", "yes", "Yes"]
|
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")):
|
if (os.environ.get("USE_DOCKER")):
|
||||||
id_filename = "/app/already_posted.txt"
|
id_filename = "/app/already_posted.txt"
|
||||||
elif (os.environ.get("USE_KUBERNETES")):
|
|
||||||
id_filename = "/data/already_posted.txt"
|
|
||||||
else:
|
else:
|
||||||
id_filename = "./already_posted.txt"
|
id_filename = "./already_posted.txt"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue