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?
-
can you show your code, how your saving the valueMeenakshiSundaram R– MeenakshiSundaram R2017年01月21日 01:36:13 +00:00Commented 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?Joseph Hovik– Joseph Hovik2017年01月23日 15:36:03 +00:00Commented Jan 23, 2017 at 15:36
1 Answer 1
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.