= 1 ? $value : self::MAX_BATCH_SIZE; } /** * Get the effective maximum batch execution time. * * @since 2.6.0 * @return int */ public static function maxBatchExecutionTime(): int { /** * Filter the maximum batch execution time in seconds. * * @since 2.6.0 * @param int $seconds Default maximum execution time. */ $value = (int) apply_filters( 'aipt_automation_max_batch_execution_time', self::MAX_BATCH_EXECUTION_TIME ); return $value >= 1 ? $value : self::MAX_BATCH_EXECUTION_TIME; } /** * Get the effective tick time budget. * * @since 2.6.0 * @return int */ public static function tickTimeBudget(): int { /** * Filter the tick time budget in seconds. * * @since 2.6.0 * @param int $seconds Default tick time budget. */ $value = (int) apply_filters( 'aipt_automation_tick_time_budget', self::TICK_TIME_BUDGET ); return $value >= 1 ? $value : self::TICK_TIME_BUDGET; } /** * Get the effective window size. * * @since 2.6.0 * @return int */ public static function windowSize(): int { /** * Filter the default window size for claimed items per tick. * * @since 2.6.0 * @param int $size Default window size. */ $value = (int) apply_filters( 'aipt_automation_window_size', self::WINDOW_SIZE ); if ( $value < self::MIN_WINDOW_SIZE || $value > self::MAX_WINDOW_SIZE ) { return self::WINDOW_SIZE; } return $value; } /** * Get the effective reschedule delay. * * @since 2.6.0 * @return int */ public static function rescheduleDelay(): int { /** * Filter the reschedule delay in seconds. * * @since 2.6.0 * @param int $seconds Default reschedule delay. */ $value = (int) apply_filters( 'aipt_automation_reschedule_delay', self::RESCHEDULE_DELAY ); return $value >= 1 ? $value : self::RESCHEDULE_DELAY; } /** * Get the effective lock TTL. * * @since 2.6.0 * @return int */ public static function lockTtl(): int { /** * Filter the per-job execution lock TTL in seconds. * * @since 2.6.0 * @param int $seconds Default lock TTL. */ $value = (int) apply_filters( 'aipt_automation_lock_ttl', self::LOCK_TTL ); return $value >= 10 ? $value : self::LOCK_TTL; } /** * Get the effective immediate execution delay. * * @since 2.6.0 * @return int */ public static function immediateExecutionDelay(): int { /** * Filter the immediate execution delay in seconds. * * @since 2.6.0 * @param int $seconds Default immediate execution delay. */ $value = (int) apply_filters( 'aipt_automation_immediate_execution_delay', self::IMMEDIATE_EXECUTION_DELAY ); return $value >= 1 ? $value : self::IMMEDIATE_EXECUTION_DELAY; } }