From b2c231280de4a1fb73f3f829a4585afe5037943b Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Thu, 22 Feb 2024 10:58:39 +0400 Subject: [PATCH] fix: cheo updated --- src/saga/choreography.ts | 7 ------- src/saga/transaction.ts | 23 +++++++++++++---------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/saga/choreography.ts b/src/saga/choreography.ts index 5ca2d63..8ba41e6 100644 --- a/src/saga/choreography.ts +++ b/src/saga/choreography.ts @@ -6,7 +6,6 @@ import { TWITTER_REFRESH_TRANSACTIONS, ANNOUNCEMENT_SEND_MESSAGE_TO_USER_TRANSACTIONS, ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS, - ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS } from './transaction'; /* define the DISCORD_UPDATE_CHANNELS choreography */ @@ -41,11 +40,6 @@ const ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL: IChoreography = { transactions: ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS } -const ANNOUNCEMENT_SAFETY_MESSAGE: IChoreography = { - name: 'ANNOUNCEMENT_SAFETY_MESSAGE', - transactions: ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS -} - /* all available Choreographies, will grow overtime */ export const ChoreographyDict = { DISCORD_UPDATE_CHANNELS, @@ -58,6 +52,5 @@ export const ChoreographyDict = { // Announcement ANNOUNCEMENT_SEND_MESSAGE_TO_USER, ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL, - ANNOUNCEMENT_SAFETY_MESSAGE } as const; diff --git a/src/saga/transaction.ts b/src/saga/transaction.ts index 3a96b5b..3723ba5 100644 --- a/src/saga/transaction.ts +++ b/src/saga/transaction.ts @@ -86,9 +86,21 @@ export const TWITTER_REFRESH_TRANSACTIONS: ITransaction[] = [ export const ANNOUNCEMENT_SEND_MESSAGE_TO_USER_TRANSACTIONS: ITransaction[] = [ { queue: Queue.DISCORD_BOT, - event: Event.DISCORD_BOT.SEND_MESSAGE, + event: Event.DISCORD_BOT.SEND_MESSAGE_TO_CHANNEL, order: 1, ...DEFAULT_TRANSACTION_PROPERTY, + }, + { + queue: Queue.SERVER_API, + event: Event.SERVER_API.ANNOUNCEMENT_SAFETY_MESSAGE, + order: 2, + ...DEFAULT_TRANSACTION_PROPERTY, + }, + { + queue: Queue.DISCORD_BOT, + event: Event.DISCORD_BOT.SEND_MESSAGE, + order: 3, + ...DEFAULT_TRANSACTION_PROPERTY, } ] @@ -100,12 +112,3 @@ export const ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS: ITransaction[] = ...DEFAULT_TRANSACTION_PROPERTY, } ] - -export const ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS: ITransaction[] = [ - { - queue: Queue.SERVER_API, - event: Event.SERVER_API.ANNOUNCEMENT_SAFETY_MESSAGE, - order: 1, - ...DEFAULT_TRANSACTION_PROPERTY, - } -] \ No newline at end of file