Endless mode 2.0+
📝 Name: repeatAfter · 🖥️ Option: --repeat-after · 🐝 Default: 0
Run cache warmup in endless loop and repeat x seconds after each run.
IMPORTANT
If cache warmup fails, the command fails immediately and is not repeated. To continue in case of failures, the allowFailures configuration option must be set as well.
Example
Define after how many seconds cache warmup should be repeated.
bash
./cache-warmup.phar --repeat-after 300json
{
"repeatAfter": 300
}php
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->repeatAfter(300);
return $config;
};yaml
repeatAfter: 300bash
CACHE_WARMUP_REPEAT_AFTER=300Disable endless mode
By default, endless mode is disabled. This can also be explicitly achieved by passing 0 as configuration value.
bash
./cache-warmup.phar --repeat-after 0json
{
"repeatAfter": 0
}php
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->disableEndlessMode();
return $config;
};yaml
repeatAfter: 0bash
CACHE_WARMUP_REPEAT_AFTER=0