From 68eda2f32236a74e54f141972fb6aaebee72079d Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Wed, 4 May 2022 14:29:45 +0200 Subject: [PATCH] Fix how-to docs on adding the default TechDocs collator. Signed-off-by: Eric Peterson --- docs/features/search/how-to-guides.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/features/search/how-to-guides.md b/docs/features/search/how-to-guides.md index c5f53c905f..d0e0fd95e6 100644 --- a/docs/features/search/how-to-guides.md +++ b/docs/features/search/how-to-guides.md @@ -67,11 +67,24 @@ getting started guide. import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-techdocs-backend'; ``` -2. Register the `DefaultTechDocsCollatorFactory` with the IndexBuilder. +2. If there isn't an existing schedule you'd like to run the collator on, be + sure to create it first. Something like... + +```typescript +import { Duration } from 'luxon'; + +const every10MinutesSchedule = env.scheduler.createScheduledTaskRunner({ + frequency: Duration.fromObject({ seconds: 600 }), + timeout: Duration.fromObject({ seconds: 900 }), + initialDelay: Duration.fromObject({ seconds: 3 }), +}); +``` + +3. Register the `DefaultTechDocsCollatorFactory` with the IndexBuilder. ```typescript indexBuilder.addCollator({ - defaultRefreshIntervalSeconds: 600, + schedule: every10MinutesSchedule, factory: DefaultTechDocsCollatorFactory.fromConfig(env.config, { discovery: env.discovery, logger: env.logger,