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

fix: fixes a bug in refreshMetadata for collection #1037

Merged
merged 2 commits into from
Apr 30, 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
5 changes: 2 additions & 3 deletions src/server-extension/resolvers/refresh_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RefreshMetadataResponse {
}

const rateLimitMap = new NodeCache({ stdTTL: 60 * 60 * 24, checkperiod: 60 * 60 })
const mins30 = 30 * 1000 * 60 * 10
const mins30 = 30 * 60 * 1000 // 30 minutes in ms

@Resolver()
export class RefreshMetadataResolver {
Expand All @@ -54,11 +54,10 @@ export class RefreshMetadataResolver {
if (timeLeft > 0) {
return {
status: RefreshMetadataResponseStatus.ERROR,
error: `Rate limit exceeded for ${collectionId}, please try again later in ${timeLeft} seconds`,
error: `You exceeded rate limit for ${collectionId}. Please retry after ${timeLeft} seconds.`,
}
}
}

rateLimitMap.set(collectionId, Date.now())
}

Expand Down