Files
backstage/.changeset/dirty-clocks-poke.md
T
Johan Haals 73480846dd add changets
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2022-05-03 13:40:02 +02:00

572 B

@backstage/backend-tasks
@backstage/backend-tasks
patch

TaskScheduleDefinition has been updated to also accept an options object containing duration information in the form of days, hours, seconds and so on. This allows for scheduling without importing luxon.

-import { Duration } from 'luxon';
// omitted other code

const schedule = env.scheduler.createScheduledTaskRunner({
-  frequency: Duration.fromObject({ minutes: 10 }),
-  timeout: Duration.fromObject({ minutes: 15 }),
+  frequency: { minutes: 10 },
+  timeout: { minutes: 15 },
   // omitted other code
});