mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
Verboser info on index updates
This commit is contained in:
parent
951b058952
commit
1a6159f765
@ -161,14 +161,14 @@ type serveOptions struct {
|
|||||||
NoBrowser bool `help:"Do not start browser"`
|
NoBrowser bool `help:"Do not start browser"`
|
||||||
NoRestart bool `env:"STNORESTART" help:"Do not restart Syncthing when exiting due to API/GUI command, upgrade, or crash"`
|
NoRestart bool `env:"STNORESTART" help:"Do not restart Syncthing when exiting due to API/GUI command, upgrade, or crash"`
|
||||||
NoDefaultFolder bool `env:"STNODEFAULTFOLDER" help:"Don't create the \"default\" folder on first startup"`
|
NoDefaultFolder bool `env:"STNODEFAULTFOLDER" help:"Don't create the \"default\" folder on first startup"`
|
||||||
NoUpgrade bool `env:"STNOUPGRADE" help:"Disable automatic upgrades"`
|
NoUpgrade bool `env:"STNOUPGRADE" help:"Disable automatic upgrades" default:"true"`
|
||||||
Paths bool `help:"Show configuration paths"`
|
Paths bool `help:"Show configuration paths"`
|
||||||
Paused bool `help:"Start with all devices and folders paused"`
|
Paused bool `help:"Start with all devices and folders paused"`
|
||||||
Unpaused bool `help:"Start with all devices and folders unpaused"`
|
Unpaused bool `help:"Start with all devices and folders unpaused"`
|
||||||
Upgrade bool `help:"Perform upgrade"`
|
Upgrade bool `help:"Perform upgrade"`
|
||||||
UpgradeCheck bool `help:"Check for available upgrade"`
|
UpgradeCheck bool `help:"Check for available upgrade"`
|
||||||
UpgradeTo string `placeholder:"URL" help:"Force upgrade directly from specified URL"`
|
UpgradeTo string `placeholder:"URL" help:"Force upgrade directly from specified URL"`
|
||||||
Verbose bool `help:"Print verbose log output"`
|
Verbose bool `help:"Print verbose log output" default:"true"`
|
||||||
Version bool `help:"Show version"`
|
Version bool `help:"Show version"`
|
||||||
|
|
||||||
// Debug options below
|
// Debug options below
|
||||||
|
@ -336,12 +336,28 @@ func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string) e
|
|||||||
}
|
}
|
||||||
fset.Update(deviceID, fs)
|
fset.Update(deviceID, fs)
|
||||||
|
|
||||||
|
var minSeq, maxSeq int64
|
||||||
|
if len(fs) > 0 {
|
||||||
|
maxSeq, minSeq = fs[0].SequenceNo(), fs[0].SequenceNo()
|
||||||
|
for _, f := range fs {
|
||||||
|
if f.SequenceNo() < minSeq {
|
||||||
|
minSeq = f.SequenceNo()
|
||||||
|
}
|
||||||
|
if f.SequenceNo() > maxSeq {
|
||||||
|
maxSeq = f.SequenceNo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
seq := fset.Sequence(deviceID)
|
seq := fset.Sequence(deviceID)
|
||||||
s.evLogger.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
s.evLogger.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
||||||
"device": deviceID.String(),
|
"device": deviceID.String(),
|
||||||
"folder": s.folder,
|
"folder": s.folder,
|
||||||
"items": len(fs),
|
"items": len(fs),
|
||||||
"sequence": seq,
|
"sequence": seq,
|
||||||
|
"update": update,
|
||||||
|
"minSeq": minSeq,
|
||||||
|
"maxSeq": maxSeq,
|
||||||
"version": seq, // legacy for sequence
|
"version": seq, // legacy for sequence
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ func (s *verboseService) formatEvent(ev events.Event) string {
|
|||||||
|
|
||||||
case events.RemoteIndexUpdated:
|
case events.RemoteIndexUpdated:
|
||||||
data := ev.Data.(map[string]interface{})
|
data := ev.Data.(map[string]interface{})
|
||||||
return fmt.Sprintf("Device %v sent an index update for %q with %d items", data["device"], data["folder"], data["items"])
|
return fmt.Sprintf("Device %v sent an index update for %q with %d items, sequence %d-%d => %d, update %v", data["device"], data["folder"], data["items"], data["minSeq"], data["maxSeq"], data["sequence"], data["update"])
|
||||||
|
|
||||||
case events.DeviceRejected:
|
case events.DeviceRejected:
|
||||||
data := ev.Data.(map[string]string)
|
data := ev.Data.(map[string]string)
|
||||||
|
Loading…
Reference in New Issue
Block a user