Release of RC1 #7
@ -80,6 +80,9 @@ class RedisTaskStorage implements TaskStorage
|
||||
// Otherwise attempt authentication, if needed
|
||||
if (isset($parameters['password']) && !$this->conn->auth($parameters['password']))
|
||||
throw new TasksException("Could not construct RedisTaskStorage. Authentication failure.");
|
||||
|
||||
// And select the DB index
|
||||
$this->conn->select($parameters['db_index']);
|
||||
} catch (RedisException $e) {
|
||||
throw new TasksException("Could not construct RedisTaskStorage. RedisException thrown: '" . $e->getMessage() . "'");
|
||||
}
|
||||
@ -296,16 +299,10 @@ class RedisTaskStorage implements TaskStorage
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws TasksException
|
||||
*/
|
||||
public function reset(): bool
|
||||
{
|
||||
// First get a list of all tasks
|
||||
foreach ($this->readTasks() as $task)
|
||||
$this->deleteTask($task);
|
||||
|
||||
$this->refreshTasks();
|
||||
|
||||
return true;
|
||||
// Clear the current db
|
||||
return $this->conn->flushDB();
|
||||
}
|
||||
}
|
@ -68,6 +68,7 @@ return array(
|
||||
'password' => Core::getEnv('TASKSTORAGE_REDIS_PASSWORD', null),
|
||||
'port' => Core::getEnv('TASKSTORAGE_REDIS_PORT', 6379),
|
||||
'timeout' => Core::getEnv('TASKSTORAGE_REDIS_TIMEOUT', 0),
|
||||
'db_index' => Core::getEnv('TASKSTORAGE_REDIS_DBINDEX', 0),
|
||||
]
|
||||
],
|
||||
'Executor' => [
|
||||
|
Loading…
Reference in New Issue
Block a user