Commit f7f9857a authored by Erick Hitter's avatar Erick Hitter
Browse files

Allow queue size and concurrency limits to be overridden

Fixed sizes faired well to start, but it's now proven useful to be able to increase these limits in a controlled fashion.

Fixes #122
parent cc626196
......@@ -3,13 +3,22 @@
namespace Automattic\WP\Cron_Control;
/**
* Job queues
* Adjustable queue size and concurrency limits, to facilitate scaling
*/
$job_queue_size = defined( 'CRON_CONTROL_JOB_QUEUE_SIZE' ) && is_numeric( \CRON_CONTROL_JOB_QUEUE_SIZE ) ? absint( \CRON_CONTROL_JOB_QUEUE_SIZE ) : 10;
define( __NAMESPACE__ . '\JOB_QUEUE_SIZE', $job_queue_size );
unset( $job_queue_size );
$job_concurrency_limit = defined( 'CRON_CONTROL_JOB_CONCURRENCY_LIMIT' ) && is_numeric( \CRON_CONTROL_JOB_CONCURRENCY_LIMIT ) ? absint( \CRON_CONTROL_JOB_CONCURRENCY_LIMIT ) : 10;
define( __NAMESPACE__ . '\JOB_CONCURRENCY_LIMIT', $job_concurrency_limit );
unset( $job_concurrency_limit );
/**
* Job runtime constraints
*/
const JOB_QUEUE_SIZE = 10;
const JOB_QUEUE_WINDOW_IN_SECONDS = 60;
const JOB_TIMEOUT_IN_MINUTES = 10;
const JOB_LOCK_EXPIRY_IN_MINUTES = 30;
const JOB_CONCURRENCY_LIMIT = 10;
/**
* Locks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment