Simplify configuration file structure

This removes most of the legacy upstream config madness by not using
weird config files spread all over the place.

This isn't the solution to other config reading fragility issues, but
it does move the whole config back to the central airtime.conf file.
This commit is contained in:
Lucas Bickel 2017-07-18 22:27:19 +02:00
parent 320b128ad8
commit fa2018a2c5
14 changed files with 46 additions and 106 deletions

View file

@ -55,7 +55,7 @@ class CeleryManager {
* results asynchronously later
*/
public static function sendCeleryMessage($task, $exchange, $data) {
$config = parse_ini_file(Application_Model_RabbitMq::getRmqConfigPath(), true);
$config = Config::getConfig();
$queue = $routingKey = $exchange;
$c = self::_setupCeleryExchange($config, $exchange, $queue); // Use the exchange name for the queue
$result = $c->PostTask($task, $data, true, $routingKey); // and routing key
@ -75,7 +75,7 @@ class CeleryManager {
* $_CELERY_MESSAGE_TIMEOUT milliseconds have passed
*/
private static function getAsyncResultMessage($task) {
$config = parse_ini_file(Application_Model_RabbitMq::getRmqConfigPath(), true);
$config = Config::getConfig();
$queue = self::$_CELERY_RESULTS_EXCHANGE . "." . $task;
$c = self::_setupCeleryExchange($config, self::$_CELERY_RESULTS_EXCHANGE, $queue);
$message = $c->getAsyncResultMessage($task->getDbName(), $task->getDbTaskId());
@ -208,4 +208,4 @@ class CeleryManager {
return (empty($dispatchTime) || $dispatchTime->add($timeoutInterval) <= $now);
}
}
}