mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: support trace on broadcast
This commit is contained in:
4 files changed
+7
-3
No files matched your search
@@ -144,12 +144,13 @@ const id = process.env.exec_mode === 'cluster_mode' ? hostname() : nanoid();
|
||||
|
||||
export async function apply(ctx: Context) {
|
||||
ctx.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
|
||||
ctx.on('bus/broadcast', (event, payload) => {
|
||||
ctx.on('bus/broadcast', (event, payload, trace) => {
|
||||
collEvent.insertOne({
|
||||
ack: [id],
|
||||
event,
|
||||
payload: BSON.EJSON.stringify(payload),
|
||||
expire: new Date(Date.now() + 10000),
|
||||
trace,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user