-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI #92
Conversation
good job 🎖️ Few notes:
when
|
.unwrap_or_else(|_| (DEFAULT_MAX_TTL_CACHED_COUNTERS_SEC * 1000).to_string()); | ||
let redis_flushing_period_default = env::var("REDIS_LOCAL_CACHE_FLUSHING_PERIOD_MS") | ||
.unwrap_or_else(|_| (DEFAULT_FLUSHING_PERIOD_SEC * 1000).to_string()); | ||
let redis_max_cached_counters_default = DEFAULT_MAX_CACHED_COUNTERS.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't configurable until now... I did not add it to the env vars tho... should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷
create issue and somebody can implement
}) | ||
} | ||
Some(("memory", _sub)) => StorageConfiguration::InMemory, | ||
None => match storage_config_from_env() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no STORAGE
has been provided, there also can't be any storage related config being passed in thru the command line, so we can safely delegate to loading all further config from the env vars or their defaults.
.unwrap_or_else(|_| (DEFAULT_MAX_TTL_CACHED_COUNTERS_SEC * 1000).to_string()); | ||
let redis_flushing_period_default = env::var("REDIS_LOCAL_CACHE_FLUSHING_PERIOD_MS") | ||
.unwrap_or_else(|_| (DEFAULT_FLUSHING_PERIOD_SEC * 1000).to_string()); | ||
let redis_max_cached_counters_default = DEFAULT_MAX_CACHED_COUNTERS.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷
create issue and somebody can implement
This is proposal for the CLI for limitador-server… Best is probably to play with it, but tl;dr:
storage
is configured as a subcommandarg
s that only apply to a given storage are passed to that subcommand onlyarg
are applied at the "root" level.I've also added a log line (with log level
info
or-vv
) that prints the config as parsed asap:Base usage
Using in-memory counters:
Using Redis
Bare
Cached counters
Infinispan