Skip to content
Snippets Groups Projects

Less cache layers

Closes #3406929

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
2356 2356 }
2357 2357
2358 2358 // Create the storage comparer and the config importer.
2359 $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage'));
2359 $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage.active'));
  • Comment on lines 2358 to +2359

    This is a trivial change, but it's not immediately obvious. based on the service names. So I suggest:

    Suggested change
    2358 // Create the storage comparer and the config importer.
    2359 $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage.active'));
    2358 // Create the storage comparer and the config importer. This is the installer,
    2359 // so do not use the `config.storage` service (caching is unnecessary at this
    2360 // time), but the `config.storage.active` service.
    2361 // @see \Drupal\Core\Installer\NormalInstallerServiceProvider::register()
    2362 $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage.active'));
  • I am not sure this providing the extra information to readers not familiar enough with the difference between the storages and doesn't tell anything new to readers who do.

    I would suggest simply saying: In the installer we use the uncached service directly @see ...

  • Please register or sign in to reply
  • Wim Leers
  • 40 40 $definition->setArguments([]);
    41 41 $definition->setMethodCalls([]);
    42 42
    43 // Make the active storage public during site install so we can access it in
    44 // install_config_import_batch() and not have double layers of cache.
    45 $definition = $container->getDefinition('config.storage.active');
    46 $definition->setPublic(TRUE);
    • Comment on lines +43 to +46
      Suggested change
      43 // Make the active storage public during site install so we can access it in
      44 // install_config_import_batch() and not have double layers of cache.
      45 $definition = $container->getDefinition('config.storage.active');
      46 $definition->setPublic(TRUE);
      43 // Make the active storage public during site install so we can access it in
      44 // install_config_import_batch() and not have double layers of cache.
      45 // @see install_config_import_batch()
      46 $definition = $container->getDefinition('config.storage.active');
      47 $definition->setPublic(TRUE);
    • Here we should explain why there is a double cache in the installer case, and not in a normal situation.

    • Please register or sign in to reply
  • closed

  • Please register or sign in to reply
    Loading