Skip to content

Commit

Permalink
Turn the P3SCRAM store into a 1 hour TTLCache
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Jan 9, 2024
1 parent aba118a commit 35f5741
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 35f5741

Please sign in to comment.