@@ -15,10 +15,10 @@ type InMemoryCache interface {
15
15
Delete (any )
16
16
}
17
17
18
- // inMemoryManifestCache provides an in-memory processor to store serverless Spec and rendered chart manifest . By using sync.Map for caching,
18
+ // inMemoryCache provides an in-memory processor to store buildless serverless key values pairs with timestamp . By using sync.Map for caching,
19
19
// concurrent operations to the processor from diverse reconciliations are considered safe.
20
20
//
21
- // Inside the processor is stored chart manifest with used custom flags by client.ObjectKey key.
21
+ // Inside the processor is stored last commit with which was git function created by repository url and reference as the key.
22
22
type inMemoryCache struct {
23
23
processor sync.Map
24
24
timeout time.Duration
@@ -29,15 +29,15 @@ type storageObject struct {
29
29
value string
30
30
}
31
31
32
- // NewInMemoryManifestCache returns a new instance of inMemoryManifestCache .
32
+ // NewInMemoryCache returns a new instance of inMemoryCache .
33
33
func NewInMemoryCache (timeout time.Duration ) * inMemoryCache {
34
34
return & inMemoryCache {
35
35
processor : sync.Map {},
36
36
timeout : timeout ,
37
37
}
38
38
}
39
39
40
- // Get loads the ServerlessSpecManifest from inMemoryManifestCache for the passed client.ObjectKey .
40
+ // Get loads from inMemoryCache for the passed key .
41
41
func (r * inMemoryCache ) Get (key any ) string {
42
42
rawValue , ok := r .processor .Load (key )
43
43
if ! ok {
@@ -51,13 +51,13 @@ func (r *inMemoryCache) Get(key any) string {
51
51
return value .value
52
52
}
53
53
54
- // Set saves the passed flags and manifest into inMemoryManifestCache for the client.ObjectKey .
54
+ // Set saves the passed last commit with which was git function created in inMemoryCache for the passed key .
55
55
func (r * inMemoryCache ) Set (key any , lastCommit string ) {
56
56
now := time .Now ()
57
57
r .processor .Store (key , & storageObject {now , lastCommit })
58
58
}
59
59
60
- // Delete deletes flags and manifest from inMemoryManifestCache for the passed client.ObjectKey .
60
+ // Delete deletes last commit with which was git function created from inMemoryCache for the passed key .
61
61
func (r * inMemoryCache ) Delete (key any ) {
62
62
r .processor .Delete (key )
63
63
}
0 commit comments