Skip to content

Commit

Permalink
Updates for web socket update
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Oct 27, 2023
1 parent a579d63 commit 5d3f4dc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ const handleJetStreamMessage = async (err, msg) => {
const data = JSON.parse(StringCodec().decode(msg.data)); // it would always be a JSON string. ii will always be choreographed event.
logger.info(`Received message, on ${msg.subject} , Sequence :: [${msg.seq}], sid :: [${msg.sid}], redelivered :: [${msg.redelivered}] :: Data ::`, data);
try {
if (data.eventType === CONSTANTS.EVENT_TYPE.UPDATE_SCHOOL
if (data.eventType === CONSTANTS.EVENT_TYPE.UPDATE_SCHOOL || CONSTANTS.EVENT_TYPE.CREATE_SCHOOL
|| data.eventType === CONSTANTS.EVENT_TYPE.UPDATE_AUTHORITY || data.eventType === CONSTANTS.EVENT_TYPE.CREATE_AUTHORITY
|| data.eventType === CONSTANTS.EVENT_TYPE.UPDATE_DISTRICT || data.eventType === CONSTANTS.EVENT_TYPE.CREATE_DISTRICT) {
await handleInstituteEvent('NT', CONSTANTS.INSTITUTE_CACHE_REFRESH_TOPIC);
}else if (data.eventType === CONSTANTS.EVENT_TYPE.CREATE_SCHOOL){
}
if (data.eventType === CONSTANTS.EVENT_TYPE.CREATE_SCHOOL){
await handleInstituteEvent(data, CONSTANTS.WS_CREATE_SCHOOL_TOPIC);
}
msg.ack(); // acknowledge to JetStream
Expand Down

0 comments on commit 5d3f4dc

Please sign in to comment.