10
10
use Algolia \AlgoliaSearch \Helper \Entity \ProductHelper ;
11
11
use Algolia \AlgoliaSearch \Service \StoreNameFetcher ;
12
12
use Magento \Framework \App \Cache \Manager as CacheManager ;
13
+ use Magento \Framework \App \Config \ReinitableConfigInterface ;
13
14
use Magento \Framework \App \Config \ScopeConfigInterface ;
14
15
use Magento \Framework \App \Config \Storage \WriterInterface ;
15
16
use Magento \Framework \App \State ;
@@ -24,18 +25,18 @@ class ReplicaDisableVirtualCommand extends AbstractReplicaCommand implements Rep
24
25
use ReplicaSyncCommandTrait;
25
26
26
27
public function __construct (
27
- protected WriterInterface $ configWriter ,
28
- protected ConfigChecker $ configChecker ,
29
- protected ScopeConfigInterface $ scopeConfig ,
30
- protected SerializerInterface $ serializer ,
31
- protected ConfigHelper $ configHelper ,
32
- protected CacheManager $ cacheManager ,
33
- protected ReplicaManagerInterface $ replicaManager ,
34
- protected StoreManagerInterface $ storeManager ,
35
- protected ProductHelper $ productHelper ,
36
- State $ state ,
37
- StoreNameFetcher $ storeNameFetcher ,
38
- ?string $ name = null
28
+ protected WriterInterface $ configWriter ,
29
+ protected ConfigChecker $ configChecker ,
30
+ protected ReinitableConfigInterface $ scopeConfig ,
31
+ protected SerializerInterface $ serializer ,
32
+ protected ConfigHelper $ configHelper ,
33
+ protected CacheManager $ cacheManager ,
34
+ protected ReplicaManagerInterface $ replicaManager ,
35
+ protected StoreManagerInterface $ storeManager ,
36
+ protected ProductHelper $ productHelper ,
37
+ State $ state ,
38
+ StoreNameFetcher $ storeNameFetcher ,
39
+ ?string $ name = null
39
40
)
40
41
{
41
42
parent ::__construct ($ state , $ storeNameFetcher , $ name );
@@ -95,7 +96,7 @@ protected function disableVirtualReplicas(array $storeIds = []): void
95
96
}
96
97
}
97
98
if ($ updates ) {
98
- $ this ->clearCache ();
99
+ $ this ->scopeConfig -> reinit ();
99
100
foreach ($ updates as $ storeId ) {
100
101
$ this ->syncReplicasForStore ($ storeId );
101
102
}
@@ -142,7 +143,7 @@ protected function disableVirtualReplicasForAllStores(): void
142
143
143
144
$ this ->configChecker ->checkAndApplyAllScopes (ConfigHelper::SORTING_INDICES , [$ this , 'disableVirtualReplicaSortConfig ' ]);
144
145
145
- $ this ->clearCache ();
146
+ $ this ->scopeConfig -> reinit ();
146
147
147
148
$ this ->syncReplicasForAllStores ();
148
149
}
@@ -174,9 +175,4 @@ function($sort) {
174
175
$ this ->configHelper ->setSorting ($ sorting , $ scope , $ scopeId );
175
176
}
176
177
177
- protected function clearCache (): void
178
- {
179
- $ this ->cacheManager ->clean (['config ' ]);
180
- }
181
-
182
178
}
0 commit comments