This has been deprecated in favor of DynamicSchedule.unregister

Parameters

keyrequired
string

Should be a stable and unique key inside the run(). See resumability for more information.

dynamicSchedulerequired
DynamicSchedule

A DynamicSchedule that will trigger any Jobs it’s attached to on a regular interval.

idrequired
string

A unique id for the interval. This is used to identify and unregister the interval later.

Returns

A Promise with the following shape:

okrequired
boolean

Whether the interval was successfully unregistered.

client.defineJob({
id: "unregister-job",
name: "Unregister dynamic schedule",
version: "0.1.1",
trigger: eventTrigger({
  name: "schedule.unregister",
  schema: z.object({
    id: z.string(),
  }),
}),
run: async (payload, io, ctx) => {
  //unregisters a DynamicSchedule with an interval 
  await io.unregisterInterval("βŒπŸ“†", dynamicSchedule, payload.id);
},
});