mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-28 01:13:15 +08:00
fix lint
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/* eslint-disable no-console,@typescript-eslint/no-explicit-any */
|
||||
|
||||
import * as crypto from 'crypto';
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { getConfig, refineConfig } from '@/lib/config';
|
||||
@@ -145,21 +144,21 @@ async function refreshRecordAndFavorites() {
|
||||
};
|
||||
|
||||
// 并发限制工具
|
||||
async function runWithConcurrency<T>(
|
||||
const runWithConcurrency = async <T>(
|
||||
tasks: (() => Promise<T>)[],
|
||||
concurrency: number
|
||||
): Promise<T[]> {
|
||||
): Promise<T[]> => {
|
||||
const results: T[] = [];
|
||||
let index = 0;
|
||||
async function worker() {
|
||||
const worker = async () => {
|
||||
while (index < tasks.length) {
|
||||
const i = index++;
|
||||
results[i] = await tasks[i]();
|
||||
}
|
||||
}
|
||||
};
|
||||
await Promise.all(Array.from({ length: Math.min(concurrency, tasks.length) }, () => worker()));
|
||||
return results;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理单个用户的播放记录和收藏
|
||||
const processUser = async (user: string) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { getAuthInfoFromCookie } from '@/lib/auth';
|
||||
import { getAvailableApiSites } from '@/lib/config';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user