Details
- Reviewers
michal varun • jon - Commits
- rCOMM51f062d47e96: [blob] Add CLI option to run cleanup task
- Existing CLI options for running server work the same - not providing any option starts the server
- cargo run -- server works the same vay as above
- cargo run -- cleanup starts the cleanup task
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
services/blob/src/main.rs | ||
---|---|---|
39–42 | With cleanup task, we no longer need to override this option. |
- Don't we need to update the command in the docker file?
- This way cargo run -- server --http-port 123 doesn't work, only cargo run -- --http-port 123 server works, which feels weird. We could potentially add global = true to all args but that also has it's problems
No, Running server is the default. For cleanup, the command is overridden in terraform ecs task definition. However I can add the ["blob", "server"] to dockerfile for clarity
- This way cargo run -- server --http-port 123 doesn't work, only cargo run -- --http-port 123 server works, which feels weird. We could potentially add global = true to all args but that also has it's problems
Yeah, I'm aware of that. Also passing --http-port is allowed when running a cleanup task too (it's a no-op then).
A more idiomatic way is to make --http-port a subcommand property: enum Command { Cleanup, Server { #[arg(...)] pub http_port: u16 } }. But Idk if it allows to omit passing the server subcommand (breaking change).
Anyway, I'm leaning towards modifying it this way and accepting a breaking change (we're bumping major anyway 😛).