Skip to content

Commit b92fd98

Browse files
committed
Log when linkcache Run is triggered
1 parent 8ab52a0 commit b92fd98

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/linkcache/cache.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ func NewListingCache(period time.Duration, dir string) *ListingCache {
5858
// updated according to the frequency specified by the period. It will run until
5959
// the context is cancelled.
6060
func (l *ListingCache) Run(ctx context.Context) {
61+
klog.Infof("Starting symlink cache watcher for directory %s with period %s", l.dir, l.period)
62+
6163
// Start the loop that runs every minute
6264
ticker := time.NewTicker(l.period)
6365
defer ticker.Stop()
@@ -150,6 +152,9 @@ func newLinkCache() *linkCache {
150152
}
151153
}
152154

155+
// AddOrUpdateDevice adds a new device or updates an existing device in the cache.
156+
// It ignores partition symlinks as they are considered noise for logging purposes.
157+
// If the symlink already exists and the real path has changed, it logs the update.
153158
func (d *linkCache) AddOrUpdateDevice(symlink, realPath string) {
154159
// Ignore partitions, which are noise as far as our logging is concerned.
155160
// Expression: -part[0-9]+$

0 commit comments

Comments
 (0)