diff options
author | Max Kostikov <max@kostikov.co> | 2019-11-18 13:00:43 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-11-18 13:00:43 +0100 |
commit | 498c021aec25d845c67150475294066113de6d20 (patch) | |
tree | c8934c83f6519bf58f27f410683e06cc6615a6a0 /Zotlabs/Daemon | |
parent | 5ee133843f166a58e0c6236e543204be8dae70d3 (diff) | |
parent | ef75d27afbbee4cfe7d4441269e350b8f7f432f9 (diff) | |
download | volse-hubzilla-498c021aec25d845c67150475294066113de6d20.tar.gz volse-hubzilla-498c021aec25d845c67150475294066113de6d20.tar.bz2 volse-hubzilla-498c021aec25d845c67150475294066113de6d20.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!5
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Cron.php | 13 | ||||
-rw-r--r-- | Zotlabs/Daemon/Cron_daily.php | 6 | ||||
-rw-r--r-- | Zotlabs/Daemon/Onepoll.php | 12 |
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; } |