You are here

protected function Database::updateJob in Advanced Queue 8

Updates the given job.

Parameters

\Drupal\advancedqueue\Job $job: The job.

3 calls to Database::updateJob()
Database::onFailure in src/Plugin/AdvancedQueue/Backend/Database.php
Called when job processing has failed.
Database::onSuccess in src/Plugin/AdvancedQueue/Backend/Database.php
Called when a job has been successfully processed.
Database::retryJob in src/Plugin/AdvancedQueue/Backend/Database.php
Retries the given job.

File

src/Plugin/AdvancedQueue/Backend/Database.php, line 256

Class

Database
Provides the database queue backend.

Namespace

Drupal\advancedqueue\Plugin\AdvancedQueue\Backend

Code

protected function updateJob(Job $job) {
  $this->connection
    ->update('advancedqueue')
    ->fields([
    'payload' => json_encode($job
      ->getPayload()),
    'state' => $job
      ->getState(),
    'message' => $job
      ->getMessage(),
    'num_retries' => $job
      ->getNumRetries(),
    'available' => $job
      ->getAvailableTime(),
    'processed' => $job
      ->getProcessedTime(),
    'expires' => $job
      ->getExpiresTime(),
  ])
    ->condition('job_id', $job
    ->getId())
    ->execute();
}