# Feature - Flush email queue with CLI command

**URL:** <https://discussions.eramba.org/t/feature-flush-email-queue-with-cli-command/1494>\
**Category:** Forum - Software\
**Created:** [April 9, 2020, 10:32am UTC](https://discussions.eramba.org/t/feature-flush-email-queue-with-cli-command/1494 "2020-04-09T10:32:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eramba](https://discussions.eramba.org/letter_avatar_proxy/v4/letter/e/c6cbf5/32.png) [@eramba](https://discussions.eramba.org/u/eramba)\
**Post date:** [April 9, 2020, 10:32am UTC](https://discussions.eramba.org/t/feature-flush-email-queue-with-cli-command/1494/1 "2020-04-09T10:32:40Z")

</div>

we need some way to override emails going out quicker than every hour (hourly cron), we will use a CLI command with options for:

- flush the queue (with a limit based on the email settings)
- flush the **last** X items (x is argument, last is of course from the oldest to the newest)
- flush X specific email id (X is the id of the item on the flush)

the process is blocking, this means that it wont let run concurrent processes, you could set a cron to run every minute if you want. what happens if the CLI is run as the daily cron runs? it should not run if hourly is pending.

int ref: [https://github.com/eramba/eramba\_v2/issues/2554](https://github.com/eramba/eramba_v2/issues/2554)
