Loading config/install/feeds.settings.yml 0 → 100644 +1 −0 Changes for config/install/feeds.settings.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line lock_timeout: 43200 config/schema/feeds.schema.yml +10 −0 Changes for config/schema/feeds.schema.yml: 10 added lines, 0 removed lines. Original line number Diff line number Diff line # Feeds global settings. feeds.settings: type: config_object label: 'Feeds settings' mapping: lock_timeout: type: integer label: 'Feed lock timeout' # Feed type configuration. feeds.feed_type.*: type: config_entity label: 'Feed type' Loading feeds.install +17 −0 Changes for feeds.install: 17 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -133,3 +133,20 @@ function feeds_update_8003() { function feeds_update_8004() { drupal_flush_all_caches(); } /** * Set the default lock timeout for Feeds imports. */ function feeds_update_8005() { $config_factory = \Drupal::configFactory(); $config = $config_factory->getEditable('feeds.settings'); $config->set('lock_timeout', 43200); $config->save(TRUE); } /** * Flush all caches to make the service "feeds.lock" available. */ function feeds_update_8006() { drupal_flush_all_caches(); } feeds.module +4 −2 Changes for feeds.module: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -101,10 +101,12 @@ function feeds_cron() { } } // Delete queued timestamp after 12 hours assuming the update has failed. // Delete queued timestamp after some time assuming the update has failed. // By default this is 12 hours, equal to the timeout set for locking a feed. $timeout = \Drupal::config('feeds.settings')->get('lock_timeout') ?? 3600 * 12; $ids = \Drupal::entityQuery('feeds_feed') ->accessCheck(FALSE) ->condition('queued', \Drupal::time()->getRequestTime() - (3600 * 12), '<') ->condition('queued', \Drupal::time()->getRequestTime() - $timeout, '<') ->condition('queued', 0, '<>') ->execute(); Loading feeds.services.yml +5 −0 Changes for feeds.services.yml: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -45,6 +45,11 @@ services: feeds.entity_finder: class: Drupal\feeds\EntityFinder arguments: ['@entity_type.manager', '@entity.repository'] feeds.lock: class: Drupal\feeds\Lock\FeedsLockBackend arguments: ['@database', '@entity_type.manager', '@config.factory'] tags: - { name: backend_overridable } feeds_plugin_form_factory: class: Drupal\feeds\Plugin\PluginFormFactory Loading Loading
config/install/feeds.settings.yml 0 → 100644 +1 −0 Changes for config/install/feeds.settings.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line lock_timeout: 43200
config/schema/feeds.schema.yml +10 −0 Changes for config/schema/feeds.schema.yml: 10 added lines, 0 removed lines. Original line number Diff line number Diff line # Feeds global settings. feeds.settings: type: config_object label: 'Feeds settings' mapping: lock_timeout: type: integer label: 'Feed lock timeout' # Feed type configuration. feeds.feed_type.*: type: config_entity label: 'Feed type' Loading
feeds.install +17 −0 Changes for feeds.install: 17 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -133,3 +133,20 @@ function feeds_update_8003() { function feeds_update_8004() { drupal_flush_all_caches(); } /** * Set the default lock timeout for Feeds imports. */ function feeds_update_8005() { $config_factory = \Drupal::configFactory(); $config = $config_factory->getEditable('feeds.settings'); $config->set('lock_timeout', 43200); $config->save(TRUE); } /** * Flush all caches to make the service "feeds.lock" available. */ function feeds_update_8006() { drupal_flush_all_caches(); }
feeds.module +4 −2 Changes for feeds.module: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -101,10 +101,12 @@ function feeds_cron() { } } // Delete queued timestamp after 12 hours assuming the update has failed. // Delete queued timestamp after some time assuming the update has failed. // By default this is 12 hours, equal to the timeout set for locking a feed. $timeout = \Drupal::config('feeds.settings')->get('lock_timeout') ?? 3600 * 12; $ids = \Drupal::entityQuery('feeds_feed') ->accessCheck(FALSE) ->condition('queued', \Drupal::time()->getRequestTime() - (3600 * 12), '<') ->condition('queued', \Drupal::time()->getRequestTime() - $timeout, '<') ->condition('queued', 0, '<>') ->execute(); Loading
feeds.services.yml +5 −0 Changes for feeds.services.yml: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -45,6 +45,11 @@ services: feeds.entity_finder: class: Drupal\feeds\EntityFinder arguments: ['@entity_type.manager', '@entity.repository'] feeds.lock: class: Drupal\feeds\Lock\FeedsLockBackend arguments: ['@database', '@entity_type.manager', '@config.factory'] tags: - { name: backend_overridable } feeds_plugin_form_factory: class: Drupal\feeds\Plugin\PluginFormFactory Loading