Class: Factorix::CLI::Commands::Cache::Evict
- Includes:
- Formatting
- Defined in:
- lib/factorix/cli/commands/cache/evict.rb
Overview
Evict cache entries
This command removes cache entries based on the specified criteria. At least one of –all, –expired, or –older-than must be specified.
Instance Method Summary collapse
-
#call(caches: nil, all: false, expired: false, older_than: nil) ⇒ void
Execute the cache evict command.
Methods included from Formatting
#format_duration, #format_size
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Method Details
#call(caches: nil, all: false, expired: false, older_than: nil) ⇒ void
This method returns an undefined value.
Execute the cache evict command
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/factorix/cli/commands/cache/evict.rb', line 48 def call(caches: nil, all: false, expired: false, older_than: nil, **) (all, expired, older_than) @older_than_seconds = parse_age(older_than) if older_than cache_names = resolve_cache_names(caches) results = cache_names.to_h {|name| [name, evict_cache(name, all:, expired:)] } output_results(results) end |