Skip to content

Commit d1c5654

Browse files
committed
added attempts method to jobs.
1 parent 8a9ed53 commit d1c5654

File tree

7 files changed

+29
-253
lines changed

7 files changed

+29
-253
lines changed

src/Illuminate/Queue/Connectors/IronConnector.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Illuminate/Queue/IronQueue.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/Illuminate/Queue/Jobs/BeanstalkdJob.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ public function release($delay = 0)
8484
$this->pheanstalk->release($this->job, $priority, $delay);
8585
}
8686

87+
/**
88+
* Get the number of times the job has been attempted.
89+
*
90+
* @return int
91+
*/
92+
public function attempts()
93+
{
94+
$stats = $this->pheanstalk->statsJob($this->job);
95+
96+
return (int) $stats->reserves;
97+
}
98+
8799
/**
88100
* Get the IoC container instance.
89101
*

src/Illuminate/Queue/Jobs/IronJob.php

Lines changed: 0 additions & 124 deletions
This file was deleted.

src/Illuminate/Queue/Jobs/Job.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ abstract public function delete();
3131
*/
3232
abstract public function release($delay = 0);
3333

34+
/**
35+
* Get the number of times the job has been attempted.
36+
*
37+
* @return int
38+
*/
39+
abstract public function attempts();
40+
3441
/**
3542
* Determine if job should be auto-deleted.
3643
*

src/Illuminate/Queue/Jobs/SyncJob.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,14 @@ public function release($delay = 0)
7373
//
7474
}
7575

76+
/**
77+
* Get the number of times the job has been attempted.
78+
*
79+
* @return int
80+
*/
81+
public function attempts()
82+
{
83+
return 1;
84+
}
85+
7686
}

src/Illuminate/Queue/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"symfony/process": "2.2.*"
1515
},
1616
"require-dev": {
17-
"iron-io/iron_mq": "1.2.*",
1817
"mockery/mockery": "0.7.2"
1918
},
2019
"autoload": {

0 commit comments

Comments
 (0)