7
7
8
8
namespace Magento \Indexer \Model \Indexer ;
9
9
10
+ use Magento \Framework \App \Cache \TypeListInterface ;
10
11
use Magento \Framework \App \CacheInterface ;
11
12
use Magento \Framework \Event \Manager as EventManager ;
12
13
use Magento \Framework \Indexer \CacheContext ;
@@ -37,22 +38,32 @@ class DeferredCacheCleaner implements DeferredCacheCleanerInterface
37
38
*/
38
39
private $ cacheContext ;
39
40
41
+ /**
42
+ * TypeListInterface
43
+ *
44
+ * @var TypeListInterface
45
+ */
46
+ private $ cacheTypeList ;
47
+
40
48
/**
41
49
* @param EventManager $eventManager
42
50
* @param CacheInterface $appCache
43
51
* @param DeferredCacheContext $deferredCacheContext
44
52
* @param CacheContext $cacheContext
53
+ * @param TypeListInterface $cacheTypeList
45
54
*/
46
55
public function __construct (
47
56
EventManager $ eventManager ,
48
57
CacheInterface $ appCache ,
49
58
DeferredCacheContext $ deferredCacheContext ,
50
- CacheContext $ cacheContext
59
+ CacheContext $ cacheContext ,
60
+ TypeListInterface $ cacheTypeList
51
61
) {
52
62
$ this ->eventManager = $ eventManager ;
53
63
$ this ->deferredCacheContext = $ deferredCacheContext ;
54
64
$ this ->appCache = $ appCache ;
55
65
$ this ->cacheContext = $ cacheContext ;
66
+ $ this ->cacheTypeList = $ cacheTypeList ;
56
67
}
57
68
58
69
/**
@@ -73,6 +84,7 @@ public function flush(): void
73
84
$ this ->deferredCacheContext ->commit ();
74
85
$ this ->eventManager ->dispatch ('clean_cache_by_tags ' , ['object ' => $ this ->cacheContext ]);
75
86
$ identities = $ this ->cacheContext ->getIdentities ();
87
+ $ this ->cacheTypeList ->cleanType ('graphql_query_resolver_result ' );
76
88
if (!empty ($ identities )) {
77
89
$ this ->appCache ->clean ($ identities );
78
90
$ this ->cacheContext ->flush ();
0 commit comments