File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,13 @@ protected function getDiscoveryXml(): string {
108108 $ discovery_url = $ this ->getDiscoveryUrl ($ config );
109109 $ xml = $ this ->loadDiscoveryXml ($ discovery_url , $ disable_checks );
110110
111+ /** @var non-negative-int $max_age */
111112 $ max_age = $ config ->get ('cool.discovery_cache_ttl ' ) ?? 3600 ;
113+ if ($ max_age === 0 ) {
114+ // The discovery cache is disabled.
115+ return $ xml ;
116+ }
117+
112118 $ expire = $ max_age + $ this ->time ->getRequestTime ();
113119
114120 $ this ->cache ->set (
Original file line number Diff line number Diff line change @@ -188,9 +188,6 @@ public function testGetDiscoveryIsCached(): void {
188188 $ fetcher ->getDiscovery ();
189189 $ this ->assertCount (5 , $ this ->httpClientGetCalls );
190190 $ fetcher ->getDiscovery ();
191- $ this ->assertCount (5 , $ this ->httpClientGetCalls );
192- $ this ->mockRequestTime = $ this ->mockRequestTime ->add (new \DateInterval ('PT1S ' ));
193- $ fetcher ->getDiscovery ();
194191 $ this ->assertCount (6 , $ this ->httpClientGetCalls );
195192 }
196193
You can’t perform that action at this time.
0 commit comments