|
@@ -66,6 +66,11 @@ const (
|
|
|
dbUpdateShortcutFile
|
|
dbUpdateShortcutFile
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+const (
|
|
|
|
|
+ defaultCopiers = 1
|
|
|
|
|
+ defaultPullers = 16
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
type dbUpdateJob struct {
|
|
type dbUpdateJob struct {
|
|
|
file protocol.FileInfo
|
|
file protocol.FileInfo
|
|
|
jobType int
|
|
jobType int
|
|
@@ -102,7 +107,7 @@ type rwFolder struct {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func newRWFolder(m *Model, shortID uint64, cfg config.FolderConfiguration) *rwFolder {
|
|
func newRWFolder(m *Model, shortID uint64, cfg config.FolderConfiguration) *rwFolder {
|
|
|
- return &rwFolder{
|
|
|
|
|
|
|
+ p := &rwFolder{
|
|
|
stateTracker: stateTracker{
|
|
stateTracker: stateTracker{
|
|
|
folder: cfg.ID,
|
|
folder: cfg.ID,
|
|
|
mut: sync.NewMutex(),
|
|
mut: sync.NewMutex(),
|
|
@@ -131,6 +136,15 @@ func newRWFolder(m *Model, shortID uint64, cfg config.FolderConfiguration) *rwFo
|
|
|
|
|
|
|
|
errorsMut: sync.NewMutex(),
|
|
errorsMut: sync.NewMutex(),
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if p.copiers == 0 {
|
|
|
|
|
+ p.copiers = defaultCopiers
|
|
|
|
|
+ }
|
|
|
|
|
+ if p.pullers == 0 {
|
|
|
|
|
+ p.pullers = defaultPullers
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return p
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Helper function to check whether either the ignorePerm flag has been
|
|
// Helper function to check whether either the ignorePerm flag has been
|