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