Skip to content

Commit

Permalink
dont double serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
NourAlharithi committed Dec 17, 2024
1 parent 81d3edb commit 10378ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export class WsClient extends EventEmitter {
const client = new WsClient('wss://events.drift.trade/ws');
const main = async () => {
client.on('connected', () => {
client.subscribe('OrderRecord', 'H5jfagEnMVNH3PMc2TU2F7tNuXE6b4zCwoL5ip1b4ZHi');
client.subscribe('OrderActionRecord', 'H5jfagEnMVNH3PMc2TU2F7tNuXE6b4zCwoL5ip1b4ZHi');
client.subscribe('OrderRecord', 'BRksHqLiq2gvQw1XxsZq6DXZjD3GB5a9J63tUBgd6QS9');
client.subscribe('OrderActionRecord', 'BRksHqLiq2gvQw1XxsZq6DXZjD3GB5a9J63tUBgd6QS9');
});
client.on('message', (data) => {
console.log('Received:', data);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class GrpcEventSubscriber {
if (serializer) {
const serialized = serializer(event.data);
serialized.rawLog = rawLog;
this.redisClient.publish(event.name, JSON.stringify(serialized));
this.redisClient.publish(event.name, serialized);
}
runningEventIndex++;
}
Expand Down

0 comments on commit 10378ad

Please sign in to comment.