patch: added classname and queue names as constants in event
This commit is contained in:
parent
b40b586342
commit
fab01abe33
|
@ -303,19 +303,19 @@ App::setResource('events', function($register) {
|
|||
}, ['register']);
|
||||
|
||||
App::setResource('audits', function($register) {
|
||||
return new Event('v1-audits', 'AuditsV1');
|
||||
return new Event(Event::AUDITS_QUEUE_NAME, Event::AUDITS_CLASS_NAME);
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('usage', function($register) {
|
||||
return new Event('v1-usage', 'UsageV1');
|
||||
return new Event(Event::USAGE_QUEUE_NAME, Event::USAGE_CLASS_NAME);
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('mails', function($register) {
|
||||
return new Event('v1-mails', 'MailsV1');
|
||||
return new Event(Event::MAILS_QUEUE_NAME, Event::MAILS_CLASS_NAME);
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('deletes', function($register) {
|
||||
return new Event('v1-deletes', 'DeletesV1');
|
||||
return new Event(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME);
|
||||
}, ['register']);
|
||||
|
||||
// Test Mock
|
||||
|
|
|
@ -13,9 +13,6 @@ use Utopia\App;
|
|||
use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
|
||||
define("DELETE_QUEUE_NAME", "v1-deletes");
|
||||
define("DELETE_CLASS_NAME", "DeletesV1");
|
||||
|
||||
// TODO: Think of a better way to access consoleDB
|
||||
function getConsoleDB() {
|
||||
global $register;
|
||||
|
|
|
@ -6,6 +6,19 @@ use Resque;
|
|||
|
||||
class Event
|
||||
{
|
||||
|
||||
const DELETE_QUEUE_NAME = 'v1-deletes';
|
||||
const DELETE_CLASS_NAME = 'DeletesV1';
|
||||
|
||||
const AUDITS_QUEUE_NAME = 'v1-audits';
|
||||
const AUDITS_CLASS_NAME = 'AuditsV1';
|
||||
|
||||
const USAGE_QUEUE_NAME = 'v1-usage';
|
||||
const USAGE_CLASS_NAME = 'UsageV1';
|
||||
|
||||
const MAILS_QUEUE_NAME = 'v1-mails';
|
||||
const MAILS_CLASS_NAME = 'MailsV1';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue