(namespace: string, execute_at: Date, opts?: Omit<CreateOptions<any>, "executeAt">)
| 20 | * @returns The scheduled task |
| 21 | */ |
| 22 | export async function schedule(namespace: string, execute_at: Date, opts?: Omit<CreateOptions<any>, "executeAt">): Promise<ScheduledTask> { |
| 23 | const task = await OpWrappers.tasks.scheduleTask({ |
| 24 | pluginId: null, |
| 25 | namespace: namespace, |
| 26 | executeAt: execute_at.getTime(), |
| 27 | data: opts?.data ?? null, |
| 28 | uniqueKey: opts?.key, |
| 29 | }); |
| 30 | |
| 31 | return convertInternalTask(task) |
| 32 | } |
| 33 | |
| 34 | export type CreateOptions<T = undefined> = { |
| 35 | executeAt: Date, |
nothing calls this directly
no test coverage detected