3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

fix: increase worker pool timeout as temp fix

This commit is contained in:
Dragory 2021-10-31 17:19:49 +02:00
parent 13c94a81cc
commit 6e3a6249c7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1,6 +1,7 @@
import { spawn, Worker, Pool } from "threads";
import "../loadEnv";
import type { CryptFns } from "./cryptWorker";
import { MINUTES } from "../utils";
if (!process.env.KEY) {
// tslint:disable-next-line:no-console
@ -9,7 +10,7 @@ if (!process.env.KEY) {
}
const KEY = process.env.KEY;
const pool = Pool(() => spawn(new Worker("./cryptWorker")), 8);
const pool = Pool(() => spawn(new Worker("./cryptWorker"), { timeout: 10 * MINUTES }), 8);
export async function encrypt(data: string) {
return pool.queue((w) => w.encrypt(data, KEY));