Skip to content

Commit eb760d7

Browse files
Merge pull request #339 from supertokens/cicd-fix
fix: cicd
2 parents a951805 + af1b547 commit eb760d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

recipe/session/recipeImplementation.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)