From: Michael Date: Wed, 24 May 2017 08:21:05 +0000 (+0000) Subject: Minimal poll intervall X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d2dd0b3248d2309fb3afd1e95a9cbd0071bed8bb;p=friendica.git Minimal poll intervall --- diff --git a/doc/htconfig.md b/doc/htconfig.md index b2f7cf66e3..2c8b44439c 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -54,6 +54,7 @@ Example: To set the directory value please add this line to your .htconfig.php: * **max_batch_queue** - Default value is 1000. * **max_processes_backend** - Maximum number of concurrent database processes for background tasks. Default value is 5. * **max_processes_frontend** - Maximum number of concurrent database processes for foreground tasks. Default value is 20. +* **min_poll_interval** - minimal distance in minutes between two polls for a contact. Default is 1. Reasonable values are between 1 and 59. * **memcache** (Boolean) - Use memcache. To use memcache the PECL extension "memcache" has to be installed and activated. * **memcache_host** - Hostname of the memcache daemon. Default is '127.0.0.1'. * **memcache_port** - Portnumber of the memcache daemon. Default is 11211. diff --git a/include/cron.php b/include/cron.php index 9b3a5e16c1..3702bf8b36 100644 --- a/include/cron.php +++ b/include/cron.php @@ -122,6 +122,8 @@ function cron_poll_contacts($argc, $argv) { $force = true; } + $min_poll_interval = Config::get('system', 'min_poll_interval', 1); + $sql_extra = (($manual_id) ? " AND `id` = $manual_id " : ""); reload_plugins(); @@ -231,7 +233,7 @@ function cron_poll_contacts($argc, $argv) { break; case 0: default: - if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 15 minute")) { + if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + ".$min_poll_interval." minute")) { $update = true; } break; diff --git a/include/items.php b/include/items.php index f6027e56ba..4a68bd2864 100644 --- a/include/items.php +++ b/include/items.php @@ -2290,15 +2290,12 @@ function drop_item($id, $interactive = true) { } } - // send the notification upstream/downstream when it is one of our posts - // We don't have to do this for foreign posts - /// @todo Check if we still can delete foreign comments on our own post - if ($item['wall'] OR $item['origin']) { - $drop_id = intval($item['id']); - $priority = ($interactive ? PRIORITY_HIGH : PRIORITY_LOW); + // send the notification upstream/downstream + // The priority depends on how the deletion is done. + $drop_id = intval($item['id']); + $priority = ($interactive ? PRIORITY_HIGH : PRIORITY_LOW); - proc_run($priority, "include/notifier.php", "drop", $drop_id); - } + proc_run($priority, "include/notifier.php", "drop", $drop_id); if (! $interactive) { return $owner;