Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
f82c797e
Commit
f82c797e
authored
Aug 01, 2017
by
Erick Hitter
Browse files
Remove ternery, fo readability
parent
02dfb196
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/constants.php
View file @
f82c797e
...
...
@@ -5,12 +5,18 @@ namespace Automattic\WP\Cron_Control;
/**
* 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
;
$job_queue_size
=
10
;
if
(
defined
(
'CRON_CONTROL_JOB_QUEUE_SIZE'
)
&&
is_numeric
(
\
CRON_CONTROL_JOB_QUEUE_SIZE
)
)
{
$job_queue_size
=
absint
(
\
CRON_CONTROL_JOB_QUEUE_SIZE
);
}
$job_queue_size
=
max
(
1
,
min
(
$job_queue_size
,
250
)
);
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
;
$job_concurrency_limit
=
10
;
if
(
defined
(
'CRON_CONTROL_JOB_CONCURRENCY_LIMIT'
)
&&
is_numeric
(
\
CRON_CONTROL_JOB_CONCURRENCY_LIMIT
)
)
{
$job_concurrency_limit
=
absint
(
\
CRON_CONTROL_JOB_CONCURRENCY_LIMIT
);
}
$job_concurrency_limit
=
max
(
1
,
min
(
$job_concurrency_limit
,
250
)
);
define
(
__NAMESPACE__
.
'\JOB_CONCURRENCY_LIMIT'
,
$job_concurrency_limit
);
unset
(
$job_concurrency_limit
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment