Moved image require to service
This commit is contained in:
parent
6aa1bf7ff6
commit
5da6207f8a
2 changed files with 4 additions and 3 deletions
3
app.js
3
app.js
|
@ -28,9 +28,6 @@ const exec = promisify(baseExec);
|
|||
// dbl posting
|
||||
import { Api } from "@top-gg/sdk";
|
||||
const dbl = process.env.NODE_ENV === "production" && process.env.DBL ? new Api(process.env.DBL) : null;
|
||||
// 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`);
|
||||
|
||||
if (isMaster) {
|
||||
const esmBotVersion = JSON.parse(readFileSync(new URL("./package.json", import.meta.url))).version;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue