aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2025-01-05 11:00:48 +0100
committerMario Vavti <mario@mariovavti.com>2025-01-05 11:00:48 +0100
commitae0d138d2ae7796d76c47bca2aabb6f6334c2ca0 (patch)
treec3f614c6768d06a052819671bacbaabd2ab256ba /Zotlabs
parent48ef4744acee2cab2202749182bab553c78e9e68 (diff)
downloadvolse-hubzilla-ae0d138d2ae7796d76c47bca2aabb6f6334c2ca0.tar.gz
volse-hubzilla-ae0d138d2ae7796d76c47bca2aabb6f6334c2ca0.tar.bz2
volse-hubzilla-ae0d138d2ae7796d76c47bca2aabb6f6334c2ca0.zip
cleanup outdated doc entries just once after the docs were imported to the db
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Importdoc.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/Zotlabs/Daemon/Importdoc.php b/Zotlabs/Daemon/Importdoc.php
index 782eded96..46f96098f 100644
--- a/Zotlabs/Daemon/Importdoc.php
+++ b/Zotlabs/Daemon/Importdoc.php
@@ -11,6 +11,18 @@ class Importdoc {
self::update_docs_dir('doc/*');
+ // remove old files that weren't updated (indicates they were most likely deleted).
+ $i = q("select id, uid from item where item_type = 5 and edited < %s - INTERVAL %s",
+ db_utcnow(),
+ db_quoteinterval('14 DAY')
+ );
+
+ if ($i) {
+ foreach ($i as $iv) {
+ drop_item($iv['id'], uid: $iv['uid']);
+ }
+ }
+
return;
}
@@ -41,18 +53,6 @@ class Importdoc {
}
}
}
-
- // remove old files that weren't updated (indicates they were most likely deleted).
- $i = q("select id, uid from item where item_type = 5 and edited < %s - INTERVAL %s",
- db_utcnow(),
- db_quoteinterval('14 DAY')
- );
-
- if ($i) {
- foreach ($i as $iv) {
- drop_item($iv['id'], uid: $iv['uid']);
- }
- }
}
}