MCPcopy
hub / github.com/docker/compose / writeWatchSyncMessage

Function writeWatchSyncMessage

pkg/compose/watch.go:698–718  ·  pkg/compose/watch.go::writeWatchSyncMessage

writeWatchSyncMessage prints out a message about the sync for the changed paths.

(log api.LogConsumer, serviceName string, pathMappings []*sync.PathMapping)

Source from the content-addressed store, hash-verified

696
697// writeWatchSyncMessage prints out a message about the sync for the changed paths.
698func writeWatchSyncMessage(log api.LogConsumer, serviceName string, pathMappings []*sync.PathMapping) {
699 if logrus.IsLevelEnabled(logrus.DebugLevel) {
700 hostPathsToSync := make([]string, len(pathMappings))
701 for i := range pathMappings {
702 hostPathsToSync[i] = pathMappings[i].HostPath
703 }
704 log.Log(
705 api.WatchLogger,
706 fmt.Sprintf(
707 "Syncing service %q after changes were detected: %s",
708 serviceName,
709 strings.Join(hostPathsToSync, ", "),
710 ),
711 )
712 } else {
713 log.Log(
714 api.WatchLogger,
715 fmt.Sprintf("Syncing service %q after %d changes were detected", serviceName, len(pathMappings)),
716 )
717 }
718}
719
720func (s *composeService) pruneDanglingImagesOnRebuild(ctx context.Context, projectName string, imageNameToIdMap map[string]string) {
721 images, err := s.apiClient().ImageList(ctx, client.ImageListOptions{

Callers 1

handleWatchBatchMethod · 0.85

Calls 1

LogMethod · 0.65

Tested by

no test coverage detected