-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(event-catalog): local emit
& broadcast
handlers changed from async to event-driven
#1096
base: master
Are you sure you want to change the base?
Changes from all commits
0ff0f9d
5e393f5
4a1f7d1
c8bdd4b
4bb2a87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,8 +81,7 @@ describe("Test Tracing feature with actions", () => { | |
|
||
await Promise.all( | ||
posts.map(async post => { | ||
const author = await ctx.call("users.get", { id: post.author }); | ||
post.author = author; //eslint-disable-line | ||
post.author = await ctx.call("users.get", { id: post.author }); | ||
return post; | ||
}) | ||
); | ||
|
@@ -124,7 +123,7 @@ describe("Test Tracing feature with actions", () => { | |
}, | ||
|
||
async handler(ctx) { | ||
let user = USERS.find(user => user.id == ctx.params.id); | ||
let user = USERS.find(user => user.id === ctx.params.id); | ||
if (user) { | ||
const span = ctx.startSpan("cloning", { | ||
tags: { | ||
|
@@ -223,7 +222,8 @@ describe("Test Tracing feature with actions", () => { | |
} | ||
}); | ||
|
||
await Promise.delay(500); | ||
// event loop lag <10ms | ||
await Promise.delay(510); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this issue is the next tick in node v10, and the test fails. The timeout should be 510ms (although it works with 501ms) because the action already has a 500ms timeout. |
||
|
||
STORE.sort((a, b) => a.startTicks - b.startTicks); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we should use an event emitter to call a non-await-ed method? I feel it's too expensive. Not enough just skip the
await
in thecallEventHandler