Moved image require to service

This commit is contained in:
Essem 2022-01-29 15:08:27 -06:00
parent 6aa1bf7ff6
commit 5da6207f8a
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 4 additions and 3 deletions

View file

@ -5,6 +5,10 @@ import path from "path";
import { fileURLToPath } from "url";
import { Worker } from "worker_threads";
// only requiring this to work around an issue regarding worker threads
const nodeRequire = createRequire(import.meta.url);
nodeRequire(`./build/${process.env.DEBUG && process.env.DEBUG === "true" ? "Debug" : "Release"}/image.node`);
import ImageConnection from "../imageConnection.js";
class ImageWorker extends BaseServiceWorker {