From 03547ec4e37aae439e54c1c91c4167acb14d51fc Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 13 Feb 2024 11:32:37 +0100 Subject: [PATCH 1/2] Avoid waiting indefinitely when the queue is empty --- src/archivist/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/archivist/index.js b/src/archivist/index.js index 83541a60c..d8dfb598c 100644 --- a/src/archivist/index.js +++ b/src/archivist/index.js @@ -112,7 +112,9 @@ export default class Archivist extends events.EventEmitter { }); }); - await this.trackingQueue.drain(); + if (this.trackingQueue.length()) { + await this.trackingQueue.drain(); + } await Promise.all([ stopHeadlessBrowser(), this.recorder.finalize() ]); this.emit('trackingCompleted', servicesIds.length, Service.getNumberOfTerms(this.services, servicesIds), extractOnly); From 16499a187d0ec17acc619c3e8b1816947d629246 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 13 Feb 2024 11:33:38 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c1e9af31..87a684f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@ All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## Unreleased [patch] + +_Full changeset and discussions: [#1050](https://github.com/OpenTermsArchive/engine/pull/1050)._ + +> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs. + +### Fixed + +- Fix engine hang with non-existent service ID ## 0.34.2 - 2024-02-12