aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r--Zotlabs/Daemon/Cron.php13
-rw-r--r--Zotlabs/Daemon/Cron_daily.php6
-rw-r--r--Zotlabs/Daemon/Onepoll.php12
3 files changed, 21 insertions, 10 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php
index 7b951e7d4..8fa31e6ce 100644
--- a/Zotlabs/Daemon/Cron.php
+++ b/Zotlabs/Daemon/Cron.php
@@ -97,13 +97,16 @@ class Cron {
// Clean expired photos from cache
- $sql_interval = "'" . dbesc(datetime_convert()) . "' - INTERVAL " . db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY');
- $r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < $sql_interval",
- intval(PHOTO_CACHE)
+ $r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
+ intval(PHOTO_CACHE),
+ db_utcnow(),
+ db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY')
);
if($r) {
- q("DELETE FROM photo WHERE photo_usage = %d AND expires < $sql_interval",
- intval(PHOTO_CACHE)
+ q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
+ intval(PHOTO_CACHE),
+ db_utcnow(),
+ db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY')
);
foreach($r as $rr) {
$file = dbunescbin($rr['content']);
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index dbfcff439..b41625963 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -44,6 +44,12 @@ class Cron_daily {
db_utcnow(), db_quoteinterval('1 YEAR')
);
+ // expire anonymous sse notification entries once a day
+
+ q("delete from xconfig where xchan like '%s'",
+ dbesc('sse_id.%')
+ );
+
//update statistics in config
require_once('include/statistics_fns.php');
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 1d9fd5f72..2f06ec125 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -61,11 +61,13 @@ class Onepoll {
if($contact['xchan_network'] === 'rss') {
logger('onepoll: processing feed ' . $contact['xchan_name'], LOGGER_DEBUG);
- handle_feed($importer['channel_id'],$contact_id,$contact['xchan_hash']);
- q("update abook set abook_connected = '%s' where abook_id = %d",
- dbesc(datetime_convert()),
- intval($contact['abook_id'])
- );
+ $alive = handle_feed($importer['channel_id'],$contact_id,$contact['xchan_hash']);
+ if ($alive) {
+ q("update abook set abook_connected = '%s' where abook_id = %d",
+ dbesc(datetime_convert()),
+ intval($contact['abook_id'])
+ );
+ }
return;
}