diff --git a/__tests__/unit/choreography.test.ts b/__tests__/unit/choreography.test.ts index 1476004..e595701 100644 --- a/__tests__/unit/choreography.test.ts +++ b/__tests__/unit/choreography.test.ts @@ -21,17 +21,11 @@ describe('choreography exists', () => { describe('DISCORD_UPDATE_CHANNELS', () => { checkChoreography(ChoreographyDict.DISCORD_UPDATE_CHANNELS, { choreographyName: 'DISCORD_UPDATE_CHANNELS', - transactionsLength: 3, - }); - }); - - describe('DISCORD_SCHEDULED_JOB', () => { - checkChoreography(ChoreographyDict.DISCORD_SCHEDULED_JOB, { - choreographyName: 'DISCORD_SCHEDULED_JOB', transactionsLength: 1, }); }); + describe('DISCORD_FETCH_MEMBERS', () => { checkChoreography(ChoreographyDict.DISCORD_FETCH_MEMBERS, { choreographyName: 'DISCORD_FETCH_MEMBERS', diff --git a/__tests__/unit/saga.schema.methods.test.ts b/__tests__/unit/saga.schema.methods.test.ts index df56754..a08854e 100644 --- a/__tests__/unit/saga.schema.methods.test.ts +++ b/__tests__/unit/saga.schema.methods.test.ts @@ -40,7 +40,7 @@ describe('Next function ( saga.next() )', () => { let taskFn: jest.Mock; beforeEach(() => { saveFn = jest.fn(); - publishFn = jest.spyOn(RabbitMQ, 'publish').mockImplementation(() => {}); + publishFn = jest.spyOn(RabbitMQ, 'publish').mockImplementation(() => { }); taskFn = jest.fn(() => ({ key: 'value' })); }); @@ -59,7 +59,7 @@ describe('Next function ( saga.next() )', () => { }, }; - const a = await next.call(that, () => {}); + const a = await next.call(that, () => { }); expect(a).toBeUndefined(); }); @@ -141,7 +141,7 @@ describe('Start function ( saga.start() )', () => { it('`start` function should work as expected', async () => { const saveFn = jest.fn(); - const publishFn = jest.spyOn(RabbitMQ, 'publish').mockImplementation(() => {}); + const publishFn = jest.spyOn(RabbitMQ, 'publish').mockImplementation(() => { }); const that: Record = { save: saveFn, diff --git a/src/enums/queue.enum.ts b/src/enums/queue.enum.ts index 1cda392..77acf77 100644 --- a/src/enums/queue.enum.ts +++ b/src/enums/queue.enum.ts @@ -5,6 +5,6 @@ export enum Queue { // TWITTER TWITTER_BOT = 'TWITTER_BOT', - + HIVEMIND = 'HIVEMIND', } diff --git a/src/saga/choreography.ts b/src/saga/choreography.ts index 8ba41e6..7ea04c0 100644 --- a/src/saga/choreography.ts +++ b/src/saga/choreography.ts @@ -1,7 +1,6 @@ import { IChoreography } from '../interfaces/choreography.interface'; import { DISCORD_FETCH_MEMBERS_TRANSACTIONS, - DISCORD_SCHEDULED_JOB_TRANSACTIONS, DISCORD_UPDATE_CHANNELS_TRANSACTIONS, TWITTER_REFRESH_TRANSACTIONS, ANNOUNCEMENT_SEND_MESSAGE_TO_USER_TRANSACTIONS, @@ -14,12 +13,6 @@ const DISCORD_UPDATE_CHANNELS: IChoreography = { transactions: DISCORD_UPDATE_CHANNELS_TRANSACTIONS, }; -/* define the DISCORD_SCHEDULED_JOB choreography */ -const DISCORD_SCHEDULED_JOB: IChoreography = { - name: 'DISCORD_SCHEDULED_JOB', - transactions: DISCORD_SCHEDULED_JOB_TRANSACTIONS, -}; - const DISCORD_FETCH_MEMBERS: IChoreography = { name: 'DISCORD_FETCH_MEMBERS', transactions: DISCORD_FETCH_MEMBERS_TRANSACTIONS, @@ -43,7 +36,6 @@ const ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL: IChoreography = { /* all available Choreographies, will grow overtime */ export const ChoreographyDict = { DISCORD_UPDATE_CHANNELS, - DISCORD_SCHEDULED_JOB, DISCORD_FETCH_MEMBERS, // Twitter diff --git a/src/saga/transaction.ts b/src/saga/transaction.ts index 3723ba5..c4e446e 100644 --- a/src/saga/transaction.ts +++ b/src/saga/transaction.ts @@ -16,19 +16,7 @@ export const DISCORD_UPDATE_CHANNELS_TRANSACTIONS: ITransaction[] = [ event: Event.DISCORD_BOT.FETCH, order: 1, ...DEFAULT_TRANSACTION_PROPERTY, - }, - { - queue: Queue.DISCORD_ANALYZER, - event: Event.DISCORD_ANALYZER.RUN, - order: 2, - ...DEFAULT_TRANSACTION_PROPERTY, - }, - { - queue: Queue.DISCORD_BOT, - event: Event.DISCORD_BOT.SEND_MESSAGE, - order: 3, - ...DEFAULT_TRANSACTION_PROPERTY, - }, + } // { TODO: reactivated later // queue: Queue.SERVER_API, // event: Event.SERVER_API.UPDATE_GUILD, @@ -37,15 +25,6 @@ export const DISCORD_UPDATE_CHANNELS_TRANSACTIONS: ITransaction[] = [ // }, ]; -export const DISCORD_SCHEDULED_JOB_TRANSACTIONS: ITransaction[] = [ - { - queue: Queue.DISCORD_ANALYZER, - event: Event.DISCORD_ANALYZER.RUN_ONCE, - order: 1, - ...DEFAULT_TRANSACTION_PROPERTY, - }, -]; - export const DISCORD_FETCH_MEMBERS_TRANSACTIONS: ITransaction[] = [ { queue: Queue.DISCORD_BOT,