From 6f097023fc9c5a1258f0697ea26435d468cb3a59 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Wed, 1 Feb 2023 15:05:48 +0000 Subject: [PATCH] keep event stream alive even if its taking a while Signed-off-by: Brian Fletcher --- .changeset/hungry-stingrays-type.md | 5 +++++ plugins/techdocs-backend/src/service/DocsSynchronizer.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/hungry-stingrays-type.md diff --git a/.changeset/hungry-stingrays-type.md b/.changeset/hungry-stingrays-type.md new file mode 100644 index 0000000000..8cb11f67a5 --- /dev/null +++ b/.changeset/hungry-stingrays-type.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +Keep the tech docs sync event stream alive even if it is taking a while to build. diff --git a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts index 647447a612..3d89d1647f 100644 --- a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts +++ b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts @@ -128,7 +128,13 @@ export class DocsSynchronizer { cache: this.cache, }); + const interval = setInterval(() => { + taskLogger.info( + 'The docs building process is taking a little bit longer to process this entity. Please bear with us.', + ); + }, 10000); const updated = await this.buildLimiter(() => docsBuilder.build()); + clearInterval(interval); if (!updated) { finish({ updated: false });