feat: 按账号调度自动学习并让首页实时跟上状态
This commit is contained in:
@@ -8,10 +8,19 @@ export const workerOptions = [
|
||||
{ label: "5", value: 5 },
|
||||
{ label: "6", value: 6 },
|
||||
{ label: "7", value: 7 },
|
||||
{ label: "8 · 最大", value: 8 },
|
||||
{ label: "8", value: 8 },
|
||||
];
|
||||
|
||||
export const dayOptions = Array.from({ length: 31 }, (_, index) => ({
|
||||
label: `${index + 1}日`,
|
||||
label: `每月 ${index + 1}号`,
|
||||
value: index + 1,
|
||||
}));
|
||||
|
||||
export const STUDY_POLL_FLOOR = 10;
|
||||
|
||||
export function studyPollSeconds(intervals: number[]): number {
|
||||
if (intervals.some((value) => value <= 0)) return STUDY_POLL_FLOOR;
|
||||
const positive = intervals.filter((value) => value > 0);
|
||||
if (!positive.length) return STUDY_POLL_FLOOR;
|
||||
return Math.max(STUDY_POLL_FLOOR, Math.min(...positive));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user