Add REST method for addition new folder to the config
I have to add new folder to ST with: get config -> parse config -> add new folder to config -> send whole config to ST API It would be better to send just new folder conf over REST.
Also it will improve use case when multiple threads add folders concurrently. In that case with current API one thread can override folder added by another thread.
This is my personal view: I think you have to restart syncthing after adding a folder anyway hence adding folders concurrently via some special API call which saves you from having to parse JSON and helping you to shave off those 10ms and then having to wait 10s for a restart makes no sense to me.
My personal feeling is that this is a won't fix, as I don't see any benefits from this apart from being able to add folders concurrently (which will still require you to restart syncthing and consume all the time you saved by parallellizing)
I also created issue to make it possible to start synchronization of folder without restarting synchronization for all other folders
And what if I have thousands of folders?
Ok, but that solves only part of the problem.
We exchange the list of folders available on each device at the handshake phase, hence after adding a folder we'd have to kill all connections and reconnect again, so it would still not gain any benefits from parallellizing.
I guess this is a reasonable request in that case, but it is a lot of work to make it happen. The hardest part probably being able to apply settings without restarting, and the second hardest is changing the protocol to support adding folders on the fly.
And what if I have thousands of folders?
AFAIK, you can read config -> parse config -> add thousands of folders -> send whole config to ST API. That's probably faster than doing thousands of API call can ever be.
@AudriusButkevicius I understand about complexity, but would it better to have another scheme of folders list exchanging than on handshake phase?
@kozec I didn't say that I'm sending thousands of API call concurrently. I already have 1000's of folders and add new one on demand.
@garagatyi I am just saying how it is now.
I understood, but have you thought about it?
Well, there is nothing to think about. Someone just needs to sit down and do it, it's not rocket science.
I don't see a lot of benefit for the average joe (or rather I see other things which would add more benefit), hence it's not on my radar of things I'd like to do, at least not in the near future.
Well, there is nothing to think about.
Do you mean changing index sharing scheme or adding folder with the API
Both I guess. The former needs a few new messages to the protocol spec (or more clever handling of existing messages when sent after handshake), the latter needs a new HTTP API call...
I am closing this, restarts are no longer needed, and if you want to add a thousand folders, get the config, parse it, add folders, post it back.