WooCommerce Code Reference

WC_Background_Updater extends WC_Background_Process
in package

WC_Background_Updater Class.

Table of Contents

__construct()  : mixed
Initiate new background process.
delete_all_batches()  : WC_Background_Process
Delete all batches.
dispatch()  : mixed
Dispatch updater.
handle_cron_healthcheck()  : mixed
Handle cron healthcheck
is_memory_exceeded()  : bool
See if the batch limit has been exceeded.
is_updating()  : bool
Is the updater running?
kill_process()  : mixed
Kill process.
schedule_cron_healthcheck()  : array<string|int, mixed>
Schedule cron healthcheck.
batch_limit_exceeded()  : bool
See if the batch limit has been exceeded.
complete()  : mixed
Complete
get_batch()  : stdClass
Get batch.
get_memory_limit()  : int
Get memory limit.
handle()  : mixed
Handle.
is_queue_empty()  : bool
Is queue empty.
schedule_event()  : mixed
Schedule fallback event.
task()  : string|bool
Task

Methods

handle_cron_healthcheck()

Handle cron healthcheck

public handle_cron_healthcheck() : mixed

Restart the background process if not already running and data exists in the queue.

Return values
mixed

schedule_cron_healthcheck()

Schedule cron healthcheck.

public schedule_cron_healthcheck(array<string|int, mixed> $schedules) : array<string|int, mixed>
Parameters
$schedules : array<string|int, mixed>

Schedules.

Return values
array<string|int, mixed>

complete()

Complete

protected complete() : mixed

Override if applicable, but ensure that the below actions are performed, or, call parent::complete().

Return values
mixed

task()

Task

protected task(string $callback) : string|bool

Override this method to perform any actions required on each queue item. Return the modified item for further processing in the next pass through. Or, return false to remove the item from the queue.

Parameters
$callback : string

Update callback function.

Return values
string|bool