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 {
108
108
$ discovery_url = $ this ->getDiscoveryUrl ($ config );
109
109
$ xml = $ this ->loadDiscoveryXml ($ discovery_url , $ disable_checks );
110
110
111
+ /** @var non-negative-int $max_age */
111
112
$ 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
+
112
118
$ expire = $ max_age + $ this ->time ->getRequestTime ();
113
119
114
120
$ this ->cache ->set (
Original file line number Diff line number Diff line change @@ -188,9 +188,6 @@ public function testGetDiscoveryIsCached(): void {
188
188
$ fetcher ->getDiscovery ();
189
189
$ this ->assertCount (5 , $ this ->httpClientGetCalls );
190
190
$ fetcher ->getDiscovery ();
191
- $ this ->assertCount (5 , $ this ->httpClientGetCalls );
192
- $ this ->mockRequestTime = $ this ->mockRequestTime ->add (new \DateInterval ('PT1S ' ));
193
- $ fetcher ->getDiscovery ();
194
191
$ this ->assertCount (6 , $ this ->httpClientGetCalls );
195
192
}
196
193
You can’t perform that action at this time.
0 commit comments