0

I have a scenario where I save a variable to the core_config_data table using an \Magento\Config\Model\ResourceModel\Config object:

$this->_resourceConfig->saveConfig(
 'mycompany/configuration/token',
 $token,
 'default',
 0
 );

then I clean the cache using \Magento\Framework\App\Cache\Manager and Magento\Framework\App\Cache\Type\Config objects:

$this->_cacheManager->clean([CacheTypeConfig::TYPE_IDENTIFIER]);

Immediately, I redirect to another page that recalls the the same config variable, but it's null.

How do we make sure the cache cleaning finished before trying to read config data?

asked Jan 20, 2017 at 23:49
2
  • can you show your code, how your saving the value Commented Jan 21, 2017 at 1:36
  • @MeenakshiSundaram R, I use a resourceConfig object to save to the variable. This is my current understanding on how to do it. Is this right? Commented Jan 23, 2017 at 15:36

1 Answer 1

0

I'm not sure if this was definitively solved, but after I upgraded to Magento 2.16, the issue was resolved. The coreConfig items are present between page loads now.

answered Feb 3, 2017 at 16:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.