Update Docs

This commit is contained in:
Daniel Mason 2018-06-22 20:13:16 +12:00
parent c906d1ed08
commit f69330d637
6 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,6 @@
## 1.4.2 (2018-05-30)
- Reimplemented credis due to issues with Redis: Connection Closed.
- Updated Docs.
## 1.4.1 (2018-05-29)
- Updated travis builds to run on PHP 7.0, 7.1 and 7.2.

View File

@ -76,9 +76,8 @@ Jobs are queued as follows:
// Required if redis is located elsewhere
Resque::setBackend('localhost:6379');
$args = array(
'name' => 'TestName'
);
$args = ['name' => 'TestName'];
Resque::enqueue('default', 'My_Job', $args);
```
@ -141,7 +140,7 @@ Resque::dequeue('default', ['My_Job']);
Resque::dequeue('default', ['My_Job' => '087df5819a790ac666c9608e2234b21e']);
// Removes job class 'My_Job' with arguments of queue 'default'
Resque::dequeue('default', ['My_Job' => array('foo' => 1, 'bar' => 2)]);
Resque::dequeue('default', ['My_Job' => ['foo' => 1, 'bar' => 2]]);
// Removes multiple jobs
Resque::dequeue('default', ['My_Job', 'My_Job2']);
@ -345,7 +344,7 @@ Resque_Event::listen('eventName', [callback]);
* A string with the name of a function
* An array containing an object and method to call
* An array containing an object and a static method to call
* A closure (PHP 5.3+)
* A closure
Events may pass arguments (documented below), so your callback should accept
these arguments.

View File

@ -41,15 +41,16 @@ $REDIS_BACKEND = getenv('REDIS_BACKEND');
// A redis database number
$REDIS_BACKEND_DB = getenv('REDIS_BACKEND_DB');
if (!empty($REDIS_BACKEND)) {
if (empty($REDIS_BACKEND_DB))
if (empty($REDIS_BACKEND_DB)) {
Resque::setBackend($REDIS_BACKEND);
else
} else {
Resque::setBackend($REDIS_BACKEND, $REDIS_BACKEND_DB);
}
}
$logLevel = false;
$LOGGING = getenv('LOGLEVEL');
if (!empty($LOGGING) ) {
if (!empty($LOGGING)) {
$logLevel = $LOGGING;
}

View File

@ -10,7 +10,7 @@
class Resque
{
const VERSION = '1.4';
const VERSION = '1.4.2';
const DEFAULT_INTERVAL = 5;

View File

@ -16,6 +16,7 @@ class Resque_Failure_Redis implements Resque_Failure_Interface
* @param object $exception Instance of the exception that was thrown by the failed job.
* @param object $worker Instance of Resque_Worker that received the job.
* @param string $queue The name of the queue the job was fetched from.
* @throws Resque_RedisException
*/
public function __construct($payload, $exception, $worker, $queue)
{

View File

@ -28,6 +28,10 @@ class Resque_Log extends Psr\Log\AbstractLogger
public function log($level, $message, array $context = [])
{
$logLevels = ["emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"];
/**
* Only log things with a higher rating than the current log level.
* e.g If set as 'alert' will only alert for 'emergency' and 'alert' logs.
*/
if (array_search($level, $logLevels) <= array_search($this->logLevel, $logLevels)) {
fwrite(
STDOUT,