class RunBuildTaskJob extends AbstractQueuedJob (View source)

A convenience wrapper for running BuildTask implementations.

These are usually executed via synchronous web request or synchronous CLI execution (under dev/tasks/*).

Caution: This job can't increment steps. This is a signal for job health checks that a job should be considered stale after a (short) timeout. If you expect a build task to run for more than a few minutes, create it as a job with steps, increase timeouts, or disable health checks. See "Defining Jobs" in the docs for details.

Methods

__construct($taskClass = null, $queryString = null)

No description

string
getTitle()

No description

string
getSignature()

Return a signature for this queued job

getJobType()

No description

int|null
getRunAsMemberID()

Specifies what user ID should be when running the job valid values: null - (default) - run the job as current user 0 - run the job without a user greater than zero - run the job as a specific user

setup()

Performs setup tasks the first time this job is run.

prepareForRestart()

Run when an already setup job is being restarted.

process()

Do some processing yourself!

jobFinished()

Method for determining whether the job is finished - you may override it if there's more to it than just this

afterComplete()

Called when the job is determined to be 'complete'

getJobData()

No description

setJobData(int $totalSteps, int $currentStep, bool $isComplete, stdClass $jobData, array $messages)

No description

array|null
getCustomConfig()

Gets custom config settings to use when running the job.

setCustomConfig(array $config)

Sets custom config settings to use when the job is run.

addMessage(string $message, string $severity = 'INFO')

No description

__set(mixed $name, mixed $value)

Convenience methods for setting and getting job data

mixed
__get(mixed $name)

Retrieve some job data

Details

__construct($taskClass = null, $queryString = null)

Parameters

$taskClass
$queryString

string getTitle()

Return Value

string

string getSignature()

Return a signature for this queued job

Return Value

string

getJobType()

int|null getRunAsMemberID()

Specifies what user ID should be when running the job valid values: null - (default) - run the job as current user 0 - run the job without a user greater than zero - run the job as a specific user

This is useful in situations like:

  • a job needs to always run without a user (like a static cache job)
  • a job needs to run as a specific user (for example data migration job)

Note that this value can be overridden in the see QueuedJobService::queueJob()

Return Value

int|null

setup()

Performs setup tasks the first time this job is run.

This is only executed once for every job. If you want to run something on every job restart, use the {@link prepareForRestart} method.

prepareForRestart()

Run when an already setup job is being restarted.

process()

Do some processing yourself!

jobFinished()

Method for determining whether the job is finished - you may override it if there's more to it than just this

afterComplete()

Called when the job is determined to be 'complete'

setJobData(int $totalSteps, int $currentStep, bool $isComplete, stdClass $jobData, array $messages)

Parameters

int $totalSteps
int $currentStep
bool $isComplete
stdClass $jobData
array $messages

array|null getCustomConfig()

Gets custom config settings to use when running the job.

Return Value

array|null

setCustomConfig(array $config)

Sets custom config settings to use when the job is run.

Parameters

array $config

addMessage(string $message, string $severity = 'INFO')

Parameters

string $message
string $severity

__set(mixed $name, mixed $value)

Convenience methods for setting and getting job data

Parameters

mixed $name
mixed $value

mixed __get(mixed $name)

Retrieve some job data

Parameters

mixed $name

Return Value

mixed