|
|
|
@ -13,13 +13,13 @@ def remove_dead_urls():
@@ -13,13 +13,13 @@ def remove_dead_urls():
|
|
|
|
|
def check_url(url): |
|
|
|
|
if url.death is not None: |
|
|
|
|
if datetime.now() > url.death : |
|
|
|
|
app.logger.info(f"Removed hash '{url.hash}'' because its retention time has passed.") |
|
|
|
|
app.logger.info(f"Removed hash '{url.hash}' because its retention time has passed.") |
|
|
|
|
db.session.delete(url) |
|
|
|
|
db.session.commit() |
|
|
|
|
return "Timeout" |
|
|
|
|
if url.view_counter is not None: |
|
|
|
|
if url.view_counter <= 0: |
|
|
|
|
app.logger.info(f"Removed hash '{url.hash}'' because its viewcouner has run out.") |
|
|
|
|
app.logger.info(f"Removed hash '{url.hash}' because its viewcouner has run out.") |
|
|
|
|
db.session.delete(url) |
|
|
|
|
db.session.commit() |
|
|
|
|
return "Counter" |
|
|
|
|