Update task schedule examples

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-05-03 13:39:54 +02:00
parent 6d06600d2b
commit f60c94b5cc
9 changed files with 27 additions and 35 deletions
+1 -2
View File
@@ -15,14 +15,13 @@ then make use of its facilities as necessary:
```typescript
import { TaskScheduler } from '@backstage/backend-tasks';
import { Duration } from 'luxon';
const scheduler = TaskScheduler.fromConfig(rootConfig).forPlugin('my-plugin');
await scheduler.scheduleTask({
id: 'refresh_things',
frequency: { cron: '*/5 * * * *' }, // every 5 minutes, also supports Duration
timeout: Duration.fromObject({ minutes: 15 }),
timeout: { minutes: 15 },
fn: async () => {
await entityProvider.run();
},