feat(cron): default isolated jobs to announce delivery and enhance scheduling options
- Updated isolated cron jobs to default to `announce` delivery mode, improving user experience. - Enhanced scheduling options to accept ISO 8601 timestamps for `schedule.at`, while still supporting epoch milliseconds. - Refined documentation to clarify delivery modes and scheduling formats. - Adjusted related CLI commands and UI components to reflect these changes, ensuring consistency across the platform. - Improved handling of legacy delivery fields for backward compatibility. This update streamlines the configuration of isolated jobs, making it easier for users to manage job outputs and schedules.
This commit is contained in:
committed by
Peter Steinberger
parent
511c656cbc
commit
0bb0dfc9bc
@@ -25,9 +25,9 @@ export const DEFAULT_CRON_FORM: CronFormState = {
|
||||
wakeMode: "next-heartbeat",
|
||||
payloadKind: "systemEvent",
|
||||
payloadText: "",
|
||||
deliveryMode: "legacy",
|
||||
deliveryMode: "announce",
|
||||
deliveryChannel: "last",
|
||||
deliveryTo: "",
|
||||
timeoutSeconds: "",
|
||||
postToMainPrefix: "",
|
||||
postToMainPrefix: "Cron",
|
||||
};
|
||||
|
||||
@@ -121,6 +121,7 @@ export async function addCronJob(state: CronState) {
|
||||
to: state.cronForm.deliveryTo.trim() || undefined,
|
||||
}
|
||||
: undefined;
|
||||
const legacyPrefix = state.cronForm.postToMainPrefix.trim() || "Cron";
|
||||
const agentId = state.cronForm.agentId.trim();
|
||||
const job = {
|
||||
name: state.cronForm.name.trim(),
|
||||
@@ -133,10 +134,8 @@ export async function addCronJob(state: CronState) {
|
||||
payload,
|
||||
delivery,
|
||||
isolation:
|
||||
state.cronForm.postToMainPrefix.trim() &&
|
||||
state.cronForm.sessionTarget === "isolated" &&
|
||||
state.cronForm.deliveryMode === "legacy"
|
||||
? { postToMainPrefix: state.cronForm.postToMainPrefix.trim() }
|
||||
state.cronForm.sessionTarget === "isolated" && state.cronForm.deliveryMode === "legacy"
|
||||
? { postToMainPrefix: legacyPrefix }
|
||||
: undefined,
|
||||
};
|
||||
if (!job.name) {
|
||||
|
||||
@@ -212,7 +212,7 @@ export function renderCron(props: CronProps) {
|
||||
})}
|
||||
>
|
||||
<option value="legacy">Main summary (legacy)</option>
|
||||
<option value="announce">Announce summary</option>
|
||||
<option value="announce">Announce summary (default)</option>
|
||||
<option value="deliver">Deliver full output</option>
|
||||
<option value="none">None (internal)</option>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user