Skip to content

Commit eebeee8

Browse files
committed
Log watch update time
1 parent 99939d9 commit eebeee8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/project/session.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ func updateWatch[T any](ctx context.Context, session *Session, logger logging.Lo
475475

476476
func (s *Session) updateWatches(oldSnapshot *Snapshot, newSnapshot *Snapshot) error {
477477
var errors []error
478+
start := time.Now()
478479
ctx := context.Background()
479480
core.DiffMapsFunc(
480481
oldSnapshot.ConfigFileRegistry.configs,
@@ -521,6 +522,8 @@ func (s *Session) updateWatches(oldSnapshot *Snapshot, newSnapshot *Snapshot) er
521522

522523
if len(errors) > 0 {
523524
return fmt.Errorf("errors updating watches: %v", errors)
525+
} else if s.options.LoggingEnabled {
526+
s.logger.Log(fmt.Sprintf("Updated watches in %v", time.Since(start)))
524527
}
525528
return nil
526529
}

0 commit comments

Comments
 (0)