Menu

## ActionScheduler_QueueCleaner
in package

ActionScheduler_QueueCleaner.php : 6

Class ActionScheduler_QueueCleaner

### Table of Contents

$batch_size : int
$month_in_seconds : int
  31 days in seconds.
$store : ActionScheduler_Store
__construct() : mixed
  ActionScheduler_QueueCleaner constructor.
clean() : mixed
  Do all of the cleaning actions.
delete_old_actions() : mixed
mark_failures() : mixed
  Mark actions that have been running for more than a given time limit as failed, based on the assumption some uncatachable and unloggable fatal error occurred during processing.
reset_timeouts() : mixed
  Unclaim pending actions that have not been run within a given time limit.
get_batch_size() : int
  Get the batch size for cleaning the queue.

### Properties

#### $batch_size

ActionScheduler_QueueCleaner.php : 9
`protected int $batch_size`

#### $month_in_seconds

ActionScheduler_QueueCleaner.php : 19

31 days in seconds.

`private int $month_in_seconds = 2678400`

#### $store

ActionScheduler_QueueCleaner.php : 12
`private ActionScheduler_Store $store = ull`

### Methods

#### __construct()

ActionScheduler_QueueCleaner.php : 27

ActionScheduler_QueueCleaner constructor.

`public __construct([ActionScheduler_Store $store = null ][, int $batch_size = 20 ]) : mixed`

##### Parameters

$store : ActionScheduler_Store = null

  The store instance.

$batch_size : int = 20

  The batch size.

##### Return values

mixed —

#### clean()

ActionScheduler_QueueCleaner.php : 135

Do all of the cleaning actions.

`public clean([int $time_limit = 300 ]) : mixed`

##### Parameters

$time_limit : int = 300

  The number of seconds to use as the timeout and failure period. Default 300 (5 minutes).

##### Tags

author

  Jeremy Pry

##### Return values

mixed —

#### delete_old_actions()

ActionScheduler_QueueCleaner.php : 32
`public delete_old_actions() : mixed`

##### Return values

mixed —

#### mark_failures()

ActionScheduler_QueueCleaner.php : 110

Mark actions that have been running for more than a given time limit as failed, based on the assumption some uncatachable and unloggable fatal error occurred during processing.

`public mark_failures([int $time_limit = 300 ]) : mixed`

When called by ActionScheduler_Abstract_QueueRunner::run_cleanup(), the time limit passed as a parameter is 10x the time limit used for queue processing.

##### Parameters

$time_limit : int = 300

  The number of seconds to allow an action to run before it is considered to have failed. Default 300 (5 minutes).

##### Return values

mixed —

#### reset_timeouts()

ActionScheduler_QueueCleaner.php : 81

Unclaim pending actions that have not been run within a given time limit.

`public reset_timeouts([int $time_limit = 300 ]) : mixed`

When called by ActionScheduler_Abstract_QueueRunner::run_cleanup(), the time limit passed as a parameter is 10x the time limit used for queue processing.

##### Parameters

$time_limit : int = 300

  The number of seconds to allow a queue to run before unclaiming its pending actions. Default 300 (5 minutes).

##### Return values

mixed —

#### get_batch_size()

ActionScheduler_QueueCleaner.php : 147

Get the batch size for cleaning the queue.

`protected get_batch_size() : int`

##### Tags

author

  Jeremy Pry

##### Return values

int —

## Search results