Search query string.
Page number (1-based, default: 1).
Results per page (default: 50).
Optionaltoken: stringOptional authentication token.
Whether to acquire rate limit slot (default: true).
Whether to bypass cache (default: false).
Promise resolving to search results.
export async function searchWithRateLimit(
query: string,
page: number = 1,
perPage: number = 50,
token?: string,
acquireLimit: boolean = true,
bypassCache: boolean = false,
): Promise<SearchResult<AniListManga>> {
// Wait for any active manual pause to be lifted
await waitWhileManuallyPaused();
// Only wait for rate limit on the first request in a batch to avoid double-waiting
if (acquireLimit) {
await acquireRateLimit();
}
// Execute the search (client handles caching independently)
return await searchManga(query, page, perPage, token, bypassCache);
}
Perform a simple search with rate limiting.
Waits for manual pause to be lifted, optionally acquires a rate limit slot, then executes the search via the AniList client. Transient errors are handled by the rate limit queue's retry mechanism.