mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
parent
c206fbdc58
commit
d0ccea0404
@ -129,6 +129,7 @@ func TestDeviceConfig(t *testing.T) {
|
||||
WeakHashThresholdPct: 25,
|
||||
MarkerName: DefaultMarkerName,
|
||||
JunctionsAsDirs: true,
|
||||
MaxConcurrentWrites: maxConcurrentWritesDefault,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,11 @@ var (
|
||||
ErrMarkerMissing = errors.New("folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)")
|
||||
)
|
||||
|
||||
const DefaultMarkerName = ".stfolder"
|
||||
const (
|
||||
DefaultMarkerName = ".stfolder"
|
||||
maxConcurrentWritesDefault = 2
|
||||
maxConcurrentWritesLimit = 64
|
||||
)
|
||||
|
||||
func NewFolderConfiguration(myID protocol.DeviceID, id, label string, fsType fs.FilesystemType, path string) FolderConfiguration {
|
||||
f := FolderConfiguration{
|
||||
@ -206,6 +210,12 @@ func (f *FolderConfiguration) prepare() {
|
||||
if f.MarkerName == "" {
|
||||
f.MarkerName = DefaultMarkerName
|
||||
}
|
||||
|
||||
if f.MaxConcurrentWrites <= 0 {
|
||||
f.MaxConcurrentWrites = maxConcurrentWritesDefault
|
||||
} else if f.MaxConcurrentWrites > maxConcurrentWritesLimit {
|
||||
f.MaxConcurrentWrites = maxConcurrentWritesLimit
|
||||
}
|
||||
}
|
||||
|
||||
// RequiresRestartOnly returns a copy with only the attributes that require
|
||||
|
Loading…
Reference in New Issue
Block a user