Skip to content

Commit

Permalink
update flag descs
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Oct 4, 2024
1 parent e05c033 commit 2eb0f8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ relay serve --port 6349

The `serve` command supports the following flags:

| Flag | Description | Default |
|:---------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
| `--port`, `-p` | Specifies the port on which the relay server will run. | `6349` |
| `--no-heartbeats` | Disables the heartbeat mechanism. When this flag is enabled, the server will not track node activity. | `false` |
| `--strategy` | Specifies the license assignment strategy. Options: `fifo`, `lifo`, `rand`. | `fifo` |
| `--ttl`, `-t` | Sets the Time-to-Live (TTL) for license claims. After this period, licenses will be automatically released. Accepts durations like `30s`, `1m`, `1h`, etc. | `30s` |
| `--cleanup-interval` | Specifies how often the server should check for inactive nodes to clean up. | `15s` |
| `--database` | Specify a custom database file for storing the license and node data. | `./relay.sqlite` |
| Flag | Description | Default |
|:---------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
| `--port`, `-p` | Specifies the port on which the relay server will run. | `6349` |
| `--no-heartbeats` | Disables the heartbeat mechanism. When this flag is enabled, the server will not automatically release inactive or dead nodes. | `false` |
| `--strategy` | Specifies the license assignment strategy. Options: `fifo`, `lifo`, `rand`. | `fifo` |
| `--ttl`, `-t` | Sets the time-to-live for license claims. Licenses will be automatically released after the time-to-live if a node heartbeat is not maintained. Options: e.g. `30s`, `1m`, `1h`, etc. | `30s` |
| `--cleanup-interval` | Specifies how often the server should check for and clean up inactive or dead nodes. | `15s` |
| `--database` | Specify a custom database file for storing the license and node data. | `./relay.sqlite` |

E.g. to start the server on port `6349`, with a 30 second node TTL and FIFO
distribution strategy:
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func ServeCmd(srv server.Server) *cobra.Command {

cmd.Flags().IntVarP(&cfg.ServerPort, "port", "p", cfg.ServerPort, "port to run the relay server on")
cmd.Flags().DurationVarP(&cfg.TTL, "ttl", "t", cfg.TTL, "time-to-live for license claims")
cmd.Flags().Bool("no-heartbeats", false, "disable heartbeat mechanism")
cmd.Flags().Bool("no-heartbeats", false, "disable node heartbeat mechanism")
cmd.Flags().Var(&cfg.Strategy, "strategy", `strategy type for license distribution e.g. "fifo", "lifo", or "rand"`)
cmd.Flags().DurationVar(&cfg.CleanupInterval, "cleanup-interval", cfg.CleanupInterval, "interval at which to cull inactive nodes.")

Expand Down

0 comments on commit 2eb0f8d

Please sign in to comment.