fixed regular deletions of files
This commit is contained in:
@@ -79,15 +79,16 @@ except mariadb.OperationalError:
|
|||||||
pass
|
pass
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
|
||||||
def remove_old_FIP_entrys():
|
def remove_old_FIP_entrys():
|
||||||
cur=db.cursor(dictionary=True)
|
cur = db.cursor(dictionary=True)
|
||||||
cur.execute(
|
cur.execute(
|
||||||
"SELECT id,filename FROM FIP WHERE HOUR(TIMEDIFF(NOW(),initTimeStamp)) > 24 "
|
"SELECT id,filename FROM FIP WHERE HOUR(TIMEDIFF(NOW(),initTimeStamp)) > 24 "
|
||||||
)
|
)
|
||||||
files=cur.fetchall()
|
files = cur.fetchall()
|
||||||
info(f"Remove Files: {files}")
|
info(f"Remove Files: {files}")
|
||||||
for file in files:
|
for file in files:
|
||||||
c.execute("DELETE FROM FIP WHERE id=?", (file["id"]))
|
c.execute("DELETE FROM FIP WHERE id=?", (file["id"],))
|
||||||
os.remove(FILES_IN_PROGRESS / file["filename"])
|
os.remove(FILES_IN_PROGRESS / file["filename"])
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ services:
|
|||||||
MARIADB_ROOT_PASSWORD: DBPassword
|
MARIADB_ROOT_PASSWORD: DBPassword
|
||||||
MARIADB_USER: app
|
MARIADB_USER: app
|
||||||
UNIZEUG_PATH: /unizeug
|
UNIZEUG_PATH: /unizeug
|
||||||
|
APP_ROOT_PATH: /python
|
||||||
MARIADB_PASSWORD: DBPassword
|
MARIADB_PASSWORD: DBPassword
|
||||||
MARIADB_DATABASE: Unizeug
|
MARIADB_DATABASE: Unizeug
|
||||||
TZ: "Europe/Vienna"
|
TZ: "Europe/Vienna"
|
||||||
|
|||||||
Reference in New Issue
Block a user