Skip to content

Commit

Permalink
chore: remove analyzer tnxs
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Jul 11, 2024
1 parent bb03f00 commit 58313a7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 41 deletions.
8 changes: 1 addition & 7 deletions __tests__/unit/choreography.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions __tests__/unit/saga.schema.methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }));
});

Expand All @@ -59,7 +59,7 @@ describe('Next function ( saga.next() )', () => {
},
};

const a = await next.call(that, () => {});
const a = await next.call(that, () => { });
expect(a).toBeUndefined();
});

Expand Down Expand Up @@ -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<string, any> = {
save: saveFn,
Expand Down
2 changes: 1 addition & 1 deletion src/enums/queue.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export enum Queue {

// TWITTER
TWITTER_BOT = 'TWITTER_BOT',

HIVEMIND = 'HIVEMIND',
}
8 changes: 0 additions & 8 deletions src/saga/choreography.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand All @@ -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
Expand Down
23 changes: 1 addition & 22 deletions src/saga/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 58313a7

Please sign in to comment.