make the original task definition into just one object

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-10-27 21:11:19 +02:00
parent b91fe07309
commit d8c28d99cf
7 changed files with 49 additions and 53 deletions
+5 -7
View File
@@ -19,15 +19,13 @@ import { TaskManager } from '@backstage/backend-tasks';
const manager = TaskManager.fromConfig(rootConfig).forPlugin('my-plugin');
const { unschedule } = await manager.scheduleTask(
'refresh-things',
{
frequency: Duration.fromObject({ minutes: 10 }),
},
async () => {
const { unschedule } = await manager.scheduleTask({
id: 'refresh-things',
frequency: Duration.fromObject({ minutes: 10 }),
fn: async () => {
await entityProvider.run();
},
);
});
```
## Documentation