Skip to content

Commit 7ec4a2e

Browse files
committed
Add checkpoint configuration option to docs and env settings
1 parent 9fdd5fe commit 7ec4a2e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

aw-sync-agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The table below details all configurable settings, their purpose, and their defa
128128
| -pluginsStrictOrder | PLUGINS_STRICT_ORDER | pluginsStrictOrder | When set to true,executes the plugins with the given order || false |
129129
| -userId | USER_ID | userId | Custom identifier for the user; defaults to the system hostname or a generated ID if unspecified. || Hostname or Generated ID |
130130
| -includeHostname | INCLUDE_HOSTNAME | includeHostname | When set to true, appends the hostname to the exported metrics for better identification in multi-user environments.Otherwise the host value is set to `Unknown` || false |
131-
131+
| -checkpoint | CHECKPOINT | checkpoint | The full path to save the checkpoint checkpoint.If not used the default file is the `checkpoint.json` || `checkpoint.json` |
132132
#### Configuration Examples
133133
<ol>
134134
<li>

aw-sync-agent/settings/settings.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ func loadEnvVariables(config *Configuration) {
121121
if value, exists := os.LookupEnv("INCLUDE_HOSTNAME"); exists {
122122
config.Settings.IncludeHostname = value == "true"
123123
}
124+
if value, exists := os.LookupEnv("CHECKPOINT"); exists {
125+
config.Settings.CheckpointFile = value
126+
}
124127

125128
}
126129

@@ -138,7 +141,7 @@ func loadFlags(config *Configuration) {
138141
flag.Var(&plugins, string(Plugins), "Plugins to load")
139142

140143
flag.BoolVar(&config.Settings.PluginsStrictOrder, string(PluginsStrictOrder), config.Settings.PluginsStrictOrder, "Plugins strict order")
141-
flag.StringVar(&config.Settings.CheckpointFile, string(checkpointFile), config.Settings.CheckpointFile, "Checkpoint File found")
144+
flag.StringVar(&config.Settings.CheckpointFile, string(checkpointFile), config.Settings.CheckpointFile, "Checkpoint File")
142145
flag.StringVar(&config.Settings.Cron, string(Cron), config.Settings.Cron, "Cron expression")
143146
flag.StringVar(&config.Settings.PrometheusSecretKey, string(PrometheusSecretKey), config.Settings.PrometheusSecretKey, "Prometheus Secret Key")
144147
flag.BoolVar(&config.Settings.AsService, string(AsService), config.Settings.AsService, "Run as service")

0 commit comments

Comments
 (0)