// Stop cleans up everything running in the background. It removes the
// folder configuration from syncthing on the local/remote servers and
// destroys the tunnels to those servers (for this folder, as connections
// are per-folder).
Stop cleans up everything running in the background. It removes the
folder configuration from syncthing on the local/remote servers and
destroys the tunnels to those servers (for this folder, as connections
are per-folder).
// Stop cleans up everything running in the background . It removes the // folder configuration from syncthing on the local / remote servers and // destroys the tunnels to those servers ( for this folder as connections // are per - folder ) .
func (f *Folder) Stop() error {
	close(f.stop)
	<-f.stop
	if f.localServer != nil {
		f.localServer.Stop()
		f.localServer.RemoveFolder(f.id)
		if err := f.localServer.Update(); err != nil {
			return err
		}
	}
	if f.remoteServer != nil {
		f.remoteServer.RemoveFolder(f.id)
		if err := f.remoteServer.Update(); err != nil {
			return err
		}
	}
	if err := f.radarConn.Close(); err != nil {
		return err
	}
	if err := f.connection.Stop(); err != nil {
		return err
	}
	log.WithFields(f.Fields()).Debug("stopped folder")
	return nil
}
func ( f * Folder ) Stop ( ) error { close ( f . stop ) <- f . stop if f . localServer != nil { f . localServer . Stop ( ) f . localServer . RemoveFolder ( f . id ) if err := f . localServer . Update ( ) ; err != nil { return err } } if f . remoteServer != nil { f . remoteServer . RemoveFolder ( f . id ) if err := f . remoteServer . Update ( ) ; err != nil { return err } } if err := f . radarConn . Close ( ) ; err != nil { return err } if err := f . connection . Stop ( ) ; err != nil { return err } log . WithFields ( f . Fields ( ) ) . Debug ( " " ) return nil }
Stop cleans up everything running in the background.
Stop cleans up everything running in the background .
// Leave the devices, there might be other syncs with those nodes. It // shouldn't be a huge deal because the tunnel will be down unless active.