Commit cea2d27c authored by gbyte.co's avatar gbyte.co

Fixing cron batch generation.

parent d6600e45
......@@ -47,20 +47,19 @@ class Batch {
* Starts the batch process depending on where it was requested from.
*/
public function start() {
batch_set($this->batch);
switch ($this->batch_info['from']) {
case 'form':
batch_set($this->batch);
break;
case 'drush':
$this->batch =& batch_get();
$this->batch['progressive'] = FALSE;
batch_set($this->batch);
drush_log($this->batch['init_message'], 'status');
drush_backend_batch_process();
break;
break;
case 'cron':
$this->batch =& batch_get();
$this->batch['progressive'] = FALSE;
batch_set($this->batch);
batch_process(); //todo: Does not take advantage of batch API and eventually runs out of memory on very large sites.
break;
}
......
......@@ -116,6 +116,8 @@ class Simplesitemap {
/**
* Gets a specific sitemap configuration from the configuration storage.
*
* @param string $key
* Configuration key, like 'entity_links'.
* @return mixed
* The requested configuration.
*/
......@@ -134,7 +136,6 @@ class Simplesitemap {
public function save_config($key, $value) {
\Drupal::service('config.factory')->getEditable('simple_sitemap.settings')
->set($key, $value)->save();
$this->initialize();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment