-
Notifications
You must be signed in to change notification settings - Fork 81
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
intervals not cleared in Deno #225
Comments
The following deno test passes unless you comment out one of the commented lines: import BottleneckLight from "npm:bottleneck/light.js";
Deno.test("BottleneckLight", async () => {
const limiter = new BottleneckLight();
// limiter.schedule(() => { console.log('hi'); });
// await new Promise((resolve) => limiter.schedule(() => { resolve(null); }));
// await new Promise((resolve) => limiter.schedule(() => { resolve(null); console.log('hi'); }));
await new Promise((resolve) => limiter.schedule(() => { console.log('hi'); resolve(null); }));
}); |
Even with |
A pretty consistent workaround seems to be the following: import BottleneckLight from "npm:bottleneck/light.js";
Deno.test("BottleneckLight", async () => {
const limiter = new BottleneckLight();
await new Promise((resolve) => limiter.schedule(() => {
resolve(null);
}));
// work around https://github.com/SGrondin/bottleneck/issues/225
await new Promise(r => setTimeout(r, 0));
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test.ts
:The text was updated successfully, but these errors were encountered: