Skip to content

lib/model: Add folders on start in model - #6135

Merged
imsodin merged 1 commit into
syncthing:masterfrom
imsodin:model/intfRestr
Nov 8, 2019
Merged

imsodin merged 1 commit into
syncthing:masterfrom
imsodin:model/intfRestr

Conversation

@imsodin

@imsodin imsodin commented Nov 7, 2019

Copy link
Copy Markdown
Member

Nobody outside of model has any business meddling directly with folders and starting folders together with the model also seems more fitting (and it has an almost neutral/slightly negative line count :) ).

Testing: Folders still start on startup.

Comment thread lib/model/model.go
// Add and start folders
for _, folderCfg := range m.cfg.Folders() {
if folderCfg.Paused {
folderCfg.CreateRoot()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error return value of folderCfg.CreateRoot is not checked (from errcheck)

@AudriusButkevicius

Copy link
Copy Markdown
Member

So I'd argue that folder adding and removal should all be dome external, to lift logic out of model to keep it slimmer.

@imsodin
imsodin merged commit bee7cce into syncthing:master Nov 8, 2019
@imsodin
imsodin deleted the model/intfRestr branch November 8, 2019 09:56
@calmh calmh added this to the v1.3.2 milestone Nov 8, 2019
calmh added a commit to calmh/syncthing that referenced this pull request Nov 11, 2019
* master:
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
  cmd/stbench: rm -r cmd/stbench (syncthing#6131)
  lib/api: Slightly unflake TestCSRFRequired by allowing longer timeout
  Fix bufferpool puts (ref syncthing#4976) (syncthing#6125)
  all: Remove dead code, fix lost msgLen checks (syncthing#6129)
  lib/upnp: Fix outdated comment (syncthing#6110)
calmh added a commit to calmh/syncthing that referenced this pull request Nov 11, 2019
* dbastr3: (37 commits)
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
  wip
  wip
  wip
  wip
  cmd/stbench: rm -r cmd/stbench (syncthing#6131)
  lib/api: Slightly unflake TestCSRFRequired by allowing longer timeout
  Fix bufferpool puts (ref syncthing#4976) (syncthing#6125)
  wip
  ...
calmh added a commit to calmh/syncthing that referenced this pull request Nov 17, 2019
* master:
  golang-ci: Skip "cognitive complexity" check for now
  lib/model: Prevent cleanup-race in testing (ref syncthing#6152) (syncthing#6155)
  gui: Decrease padding on the panel and modal bodies (syncthing#6153)
  lib/model: In tests prevent goroutine leaks and increase timeouts (syncthing#6152)
  lib/model: Simplify pull error/retry logic (fixes syncthing#6139) (syncthing#6141)
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
calmh added a commit that referenced this pull request Nov 24, 2019
@calmh calmh modified the milestones: v1.3.2, v1.3.3 Nov 24, 2019
calmh added a commit to calmh/syncthing that referenced this pull request Nov 24, 2019
…nto logsuppression

* 'logsuppression' of https://github.com/calmh/syncthing:
  wip
  golang-ci: Skip "cognitive complexity" check for now
  lib/model: Prevent cleanup-race in testing (ref syncthing#6152) (syncthing#6155)
  gui: Decrease padding on the panel and modal bodies (syncthing#6153)
  lib/model: In tests prevent goroutine leaks and increase timeouts (syncthing#6152)
  lib/model: Simplify pull error/retry logic (fixes syncthing#6139) (syncthing#6141)
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Nov 8, 2020
@syncthing syncthing locked and limited conversation to collaborators Nov 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants