Skip to content

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 300
json
{
    "repeatAfter": 300
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->repeatAfter(300);

    return $config;
};
yaml
repeatAfter: 300
bash
CACHE_WARMUP_REPEAT_AFTER=300

Disable 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 0
json
{
    "repeatAfter": 0
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->disableEndlessMode();

    return $config;
};
yaml
repeatAfter: 0
bash
CACHE_WARMUP_REPEAT_AFTER=0

Released under the GNU General Public License 3.0 (or later)