Skip to main content
bunny:task runs one background task now, without Payload jobs:
The plugin registers this command in Payload’s cli.commands. It is there when stream.cleanup or stream.status.sync is on and your config does not set cli: false. A cli.commands['bunny:task'] entry of your own takes precedence.

Arguments and options

Output and exit code

The command logs the counts with the [bunny:tasks] prefix:
  • cleanup: deletedCount, errorCount and hasMore;
  • status-sync: checked, updated, failed and hasMore.
It exits with 1 when errorCount or failed is above 0, or when the task cannot run, for example because it is off. Otherwise it exits with 0. hasMore: true means there is more work left, for example because the run reached its time budget or more items were waiting than one run takes. It does not change the exit code: run the command again to continue.
This run could not check one video, so it exits with 1:
A run without errors prints "success": true and has no exitCode key.

Run it from a server cron

The command loads your Payload config, so run it where the config and its environment variables are available:
On serverless hosts, use the plugin endpoint or the Payload jobs runner instead.