File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ func getJWKSFromCacheIfPresent() *sessmodels.GetJWKSResult {
6363 // from the cores again after the entry in the cache is expired
6464 if (currentTime - jwksCache .LastFetched ) < JWKCacheMaxAgeInMs {
6565 if supertokens .IsRunningInTestMode () {
66+ if len (returnedFromCache ) == cap (returnedFromCache ) { // need to clear the channel if full because it's not being consumed in the test
67+ close (returnedFromCache )
68+ returnedFromCache = make (chan bool , 1000 )
69+ }
6670 returnedFromCache <- true
6771 }
6872
@@ -116,6 +120,10 @@ func getJWKS() (*keyfunc.JWKS, error) {
116120 jwksCache = & jwksResult
117121
118122 if supertokens .IsRunningInTestMode () {
123+ if len (returnedFromCache ) == cap (returnedFromCache ) { // need to clear the channel if full because it's not being consumed in the test
124+ close (returnedFromCache )
125+ returnedFromCache = make (chan bool , 1000 )
126+ }
119127 returnedFromCache <- false
120128 }
121129
You can’t perform that action at this time.
0 commit comments