/** * @param string $status * @param array $meta * @throws BufferedJobNotFoundException */ private function markJobAsFinished($status, array $meta) { if (!$this->database->has('queued_jobs', $meta['buffered_job_id'])) { throw new BufferedJobNotFoundException("", $meta['buffered_job_id'], $meta); } $row = $this->database->delete('queued_jobs', $meta['buffered_job_id']); $this->database->insert("{$status}_jobs", $meta['buffered_job_id'], $row); }
public function publishBatch() { $this->in_batch = false; foreach ($this->batched_jobs as $job) { $job['queued_job_id'] = uniqid(); $this->database->delete('buffered_jobs', $job['buffered_job_id']); $this->database->insert('queued_jobs', $job['buffered_job_id'], $job); } $this->batched_jobs = []; }
/** * @covers ::delete * @expectedException Exception */ public function testAnExceptionIsThrownIfANonExistentRowIsDeleted() { $this->database->delete('buffered_jobs', 1); }