feat: rest hash and handler sweeping (#7255)

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Suneet Tipirneni
2022-01-17 07:50:41 -05:00
committed by GitHub
parent e65da44d9c
commit 3bb4829800
5 changed files with 139 additions and 7 deletions

View File

@@ -19,6 +19,9 @@ export const DefaultRestOptions: Required<RESTOptions> = {
timeout: 15_000,
userAgentAppendix: `Node.js ${process.version}`,
version: APIVersion,
hashSweepInterval: 14_400_000, // 4 Hours
hashLifetime: 86_400_000, // 24 Hours
handlerSweepInterval: 3_600_000, // 1 Hour
};
/**
@@ -30,6 +33,8 @@ export const enum RESTEvents {
RateLimited = 'rateLimited',
Request = 'request',
Response = 'response',
HashSweep = 'hashSweep',
HandlerSweep = 'handlerSweep',
}
export const ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'] as const;