Skip to content
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

Remove bottleneck library 🍼 #18

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions utils/DnsLookup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Bottleneck from 'bottleneck';
import DataLoader from 'dataloader';
import dnsPacket, {
type Answer,
Expand Down Expand Up @@ -137,11 +136,6 @@ class DnsLookup {
});
}

private limiter = new Bottleneck({
maxConcurrent: 10,
minTime: 160,
});

private requestLoader = new DataLoader<
{
domain: string;
Expand All @@ -154,9 +148,7 @@ class DnsLookup {
async (keys) =>
Promise.all(
keys.map(async ({ domain, type, nameserver }) =>
this.limiter.schedule(() =>
this.sendRequest(domain, type, nameserver)
)
this.sendRequest(domain, type, nameserver)
)
),
{
Expand Down
Loading