Skip to content

Advanced Queue Setup In CLI mode

khungate edited this page Jun 21, 2023 · 9 revisions

Setting Up Advanced Queue in Command Line Interface (CLI) Mode

The following instructions guide you on how to set up an advanced queue in CLI mode for your Mailchimp integration with WooCommerce.

Preparation

From version v2.3 onwards, we've switched the queue processing system to Action Scheduler, making some of our previous functions redundant. If you have any of the following constants in your wp-config.php file, please remove them:

  • DISABLE_WP_HTTP_WORKER
  • MAILCHIMP_USE_CURL
  • MAILCHIMP_REST_LOCALHOST
  • MAILCHIMP_REST_IP
  • MAILCHIMP_DISABLE_QUEUE

Running the Queue Process

You have two options to run the queue process using a cronjob command:

  1. Run it on a cron schedule every minute: Use the following command, replacing "yourdomain.com" with your actual domain, and "/full/path/to/install/" with the full path to your WordPress installation:
```
* * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ action-scheduler run --group="mc-woocommerce"
```
  1. Use a process manager like Monit or Supervisord: The command is similar to the one above, but without the cron schedule:
```
/usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ run --group="mc-woocommerce"
```

Advanced Usage

For more advanced uses of the Mailchimp for WooCommerce/Action Scheduler CLI, please refer to the Action Scheduler documentation. Remember to always use the --group option as follows: --group="mc-woocommerce".

For Legacy Versions (Prior to v2.3)

If you're using a version of the plugin prior to v2.3, it's recommended to run the queue in CLI mode. First, define a constant in your config file as follows: define('DISABLE_WP_HTTP_WORKER', true);. Then, you have two options to run this process:

  1. Run it on a cron schedule every minute: Use the following command, replacing "yourdomain.com" and "/full/path/to/install/" as explained above:
```
* * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen
```
  1. Use a process manager like Monit or Supervisord: The command is similar to the one above, but without the cron schedule:
```
/usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen
```

Remember, these instructions are specifically for legacy versions of the plugin prior to v2.3.

Clone this wiki locally