Skip to content

Commit

Permalink
Merge pull request #339 from supertokens/cicd-fix
Browse files Browse the repository at this point in the history
fix: cicd
  • Loading branch information
rishabhpoddar authored Aug 14, 2023
2 parents a951805 + af1b547 commit eb760d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions recipe/session/recipeImplementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func getJWKSFromCacheIfPresent() *sessmodels.GetJWKSResult {
// from the cores again after the entry in the cache is expired
if (currentTime - jwksCache.LastFetched) < JWKCacheMaxAgeInMs {
if supertokens.IsRunningInTestMode() {
if len(returnedFromCache) == cap(returnedFromCache) { // need to clear the channel if full because it's not being consumed in the test
close(returnedFromCache)
returnedFromCache = make(chan bool, 1000)
}
returnedFromCache <- true
}

Expand Down Expand Up @@ -116,6 +120,10 @@ func getJWKS() (*keyfunc.JWKS, error) {
jwksCache = &jwksResult

if supertokens.IsRunningInTestMode() {
if len(returnedFromCache) == cap(returnedFromCache) { // need to clear the channel if full because it's not being consumed in the test
close(returnedFromCache)
returnedFromCache = make(chan bool, 1000)
}
returnedFromCache <- false
}

Expand Down

0 comments on commit eb760d7

Please sign in to comment.