Save a list of stopped services for mobile provider - #5822
Conversation
| // FlagStoppedServices a comma-separated list of stopped services. | ||
| FlagStoppedServices = cli.StringFlag{ | ||
| Name: "stopped-services", | ||
| Usage: "Comma separated list of stopped services.", |
There was a problem hiding this comment.
Why do we need an extra flag for stopped services? All services without active services already list stopped services, right?
There was a problem hiding this comment.
Yes, we are tracking which services to start so to me it seems like:
all services - which to start = which are stopped
:)
There was a problem hiding this comment.
This flag is used in order to store a list of stopped services in a config file (user-config.toml).
On mobile app shutdown we store this list, so that on app start - we can start exactly the same set of services.
There was a problem hiding this comment.
yes, I still see no reason for storing extra flags for stopped services if you can get them from other flags.
There was a problem hiding this comment.
There is a flag:
// FlagActiveServices a comma-separated list of active services.
FlagActiveServices = cli.StringFlag{
Name: "active-services",
Usage: "Comma separated list of active services.",
Value: strings.Join([]string{"wireguard", "scraping", "data_transfer"}, ","),
}
If you stop the app, you do not overwrite that flag. If you start the app these services are started automatically.
If you stop a single service from the UI it overwrites the flag to not start that service on the next restart.
There was a problem hiding this comment.
If you stop the app, you do not overwrite that flag.
In the mobile provider use-case when we need to stop the node temporarilty (shortage of battery or traffic) we don't stop the node, we just stop all active services.
Yes, this is a workaround, the reason is - if I stop/start the whole node a few times it misbehaves.
There was a problem hiding this comment.
if I stop/start the whole node a few times it misbehaves.
This sounds like we need to fix that problem instead of adding more flags/workarounds.
There was a problem hiding this comment.
@soffokl
Yes, it's a workaround. Bug is not trivial to fix. May be we could use this work-around (only for mobile) until the bug is fixed ?
c635f06 to
a61d527
Compare
a61d527 to
959c7db
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #5822 +/- ##
==========================================
- Coverage 37.66% 37.58% -0.08%
==========================================
Files 372 372
Lines 20721 20748 +27
==========================================
- Hits 7804 7799 -5
- Misses 12144 12172 +28
- Partials 773 777 +4
|
…pped-services config value
66fd4de to
d172e7e
Compare
| FlagStoppedServices = cli.StringFlag{ | ||
| Name: "stopped-services", | ||
| Usage: "Comma separated list of stopped services.", | ||
| Value: strings.Join([]string{}, ","), |
There was a problem hiding this comment.
OK, I'm giving up. Mark this flag at least as hidden.
| Value: strings.Join([]string{}, ","), | |
| Value: strings.Join([]string{}, ","), | |
| Hidden: true, |
385b94c to
9a914fa
Compare
No description provided.