fix(schedules): cron sample for schema test, lint cleanups
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4d4c023fed
commit
5843527317
4 files changed
+4
-2
No files matched your search
@@ -42,7 +42,7 @@ export interface JobRunResult {
|
|||||||
agentRunId?: string | null;
|
agentRunId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type JobRunFn = (c: JobRunContext) => Promise<JobRunResult | undefined | void>;
|
export type JobRunFn = (c: JobRunContext) => Promise<JobRunResult | undefined>;
|
||||||
|
|
||||||
export interface ScheduledJobDef {
|
export interface ScheduledJobDef {
|
||||||
/** 稳定 key(表主键),如 feeds.poll */
|
/** 稳定 key(表主键),如 feeds.poll */
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ describe.skipIf(!hasPg)("定时任务注册表(真实 PG)", () => {
|
|||||||
defaults: { name: "锁", group: "maintain", schedule: { type: "interval", everyMs: 1 } },
|
defaults: { name: "锁", group: "maintain", schedule: { type: "interval", everyMs: 1 } },
|
||||||
run: async () => {
|
run: async () => {
|
||||||
ran.push(name);
|
ran.push(name);
|
||||||
|
return {};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export function AgentCheckDialog({
|
|||||||
|
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
const e: Record<string, string> = {};
|
const e: Record<string, string> = {};
|
||||||
if ((!job || !job.builtin) && !d.name.trim()) e.name = "名称不能为空";
|
if (!job?.builtin && !d.name.trim()) e.name = "名称不能为空";
|
||||||
const everyMs = Math.round(Number(d.every) * UNIT_MS[d.unit]);
|
const everyMs = Math.round(Number(d.every) * UNIT_MS[d.unit]);
|
||||||
if (!cronJob && (!Number.isFinite(everyMs) || everyMs < MIN_INTERVAL_MS)) e.every = "填正数";
|
if (!cronJob && (!Number.isFinite(everyMs) || everyMs < MIN_INTERVAL_MS)) e.every = "填正数";
|
||||||
const tools = Number(d.maxToolCalls);
|
const tools = Number(d.maxToolCalls);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ const STRING_CANDIDATES = [
|
|||||||
"测试 Test",
|
"测试 Test",
|
||||||
"123456",
|
"123456",
|
||||||
`lib:${UUID}`,
|
`lib:${UUID}`,
|
||||||
|
"30 3 * * *",
|
||||||
];
|
];
|
||||||
const NUMBER_CANDIDATES = [1, 50, 2024, 0.5, 0, 4096, 128000];
|
const NUMBER_CANDIDATES = [1, 50, 2024, 0.5, 0, 4096, 128000];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user