Skip to content

Commit f6f317a

Browse files
committed
add comments for refresh
1 parent 278b456 commit f6f317a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/instancemgmt/intance_manager_ttl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func (im *instanceManagerWithTTL) Get(ctx context.Context, pluginContext backend
6969
needsUpdate := im.provider.NeedsUpdate(ctx, pluginContext, ci)
7070

7171
if !needsUpdate {
72+
// SetDefault() creates a new cache entry with fresh TTL, effectively extending the instance's lifetime.
7273
im.cache.SetDefault(cacheKey, ci)
7374
return ci.instance, nil
7475
}
@@ -82,6 +83,7 @@ func (im *instanceManagerWithTTL) Get(ctx context.Context, pluginContext backend
8283
needsUpdate := im.provider.NeedsUpdate(ctx, pluginContext, ci)
8384

8485
if !needsUpdate {
86+
// SetDefault() creates a new cache entry with fresh TTL, effectively extending the instance's lifetime.
8587
im.cache.SetDefault(cacheKey, ci)
8688
return ci.instance, nil
8789
}

0 commit comments

Comments
 (0)