Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 181b3d1

Browse files
author
danecreekphotography
authored
Relax startup check for watchObject folders (#343)
* v5.1.0 fails to start Fixes #342 * Remove npm audit from ci check
1 parent e3bda37 commit 181b3d1

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ jobs:
3434

3535
- run: npm ci
3636
- run: npm run lint
37-
- run: npm audit
3837
- run: npm test
3938
- run: npm run webpack

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
- Relax the test for valid watchObject folders at startup. If the path has globs in it a warning will still get
6+
thrown but system startup will proceed. Resolves [issue 342](https://github.com/danecreekphotography/node-deepstackai-trigger/issues/342).
7+
38
## Version 5.1.0
49

510
- Warnings are now shown when `annotateImage` is `true` for a trigger handler but `enableAnnotations` wasn't set

src/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ async function startup(): Promise<void> {
8181
WebServer.startApp();
8282
}
8383

84-
// Load the trigger configuration.
84+
// Load the trigger configuration. Verifying the location is just a quick check for basic
85+
// mounting issues. It doesn't stop the startup of the system since globs are valid in
86+
// watchObject paths and that's not something that can easily be verified.
8587
triggersFilePath = TriggerManager.loadConfiguration(["/run/secrets/triggers", "/config/triggers.json"]);
86-
if (!TriggerManager.verifyTriggerWatchLocations()) {
87-
throw Error(`Unable to access one or more watch locations.`);
88-
}
88+
TriggerManager.verifyTriggerWatchLocations();
8989

9090
// Initialize the other handler managers. MQTT got done earlier
9191
// since it does double-duty and sends overall status messages for the system.
@@ -179,11 +179,11 @@ async function hotLoadTriggers(path: string) {
179179
// Shut down things that are running
180180
await TriggerManager.stopWatching();
181181

182+
// Load the trigger configuration. Verifying the location is just a quick check for basic
183+
// mounting issues. It doesn't stop the startup of the system since globs are valid in
184+
// watchObject paths and that's not something that can easily be verified.
182185
TriggerManager.loadConfiguration([path]);
183-
if (!TriggerManager.verifyTriggerWatchLocations()) {
184-
log.warn("Main", `Unable to access one or more watch locations.`);
185-
return;
186-
}
186+
TriggerManager.verifyTriggerWatchLocations();
187187

188188
TriggerManager.startWatching();
189189
}

0 commit comments

Comments
 (0)