Skip to content

Commit

Permalink
Merge pull request #45 from feenkcom/master
Browse files Browse the repository at this point in the history
Turn the P3SCRAM store into a 1 hour TTLCache
  • Loading branch information
svenvc authored Jan 9, 2024
2 parents ff4750f + 35f5741 commit 31a0a67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions P3/P3SCRAM.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ P3SCRAM class >> shutDown [

{ #category : #accessing }
P3SCRAM class >> store [
"I maintain a store with instances registered under a key"
"I maintain a store with instances registered under a key, using a TTLCache of 1 hour"

^ Store ifNil: [ Store := Dictionary new ]
^ Store ifNil: [ Store := TTLCache new timeToLive: 1 hour; yourself ]
]

{ #category : #accessing }
P3SCRAM class >> storeAt: key ifAbsentPut: block [
"If my store holds a previously registered and used instance, return it,
else evaluate block, which should return a newly created instance, that I store and return.
Used instances cache their saltedPassword for imrpoved performance."
Used instances cache their saltedPassword for improved performance for 1 hour."

^ self store
at: key
Expand Down

0 comments on commit 31a0a67

Please sign in to comment.