mirror of
https://github.com/Horhik/Instagram2Fedi.git
synced 2024-11-13 04:03:17 +00:00
PVC debugging
This commit is contained in:
parent
4a0de99672
commit
c29bd05f3b
|
@ -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())
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue