1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-06-04 00:53:50 -04:00

3.0.0 release, support Deno 2.X

This commit is contained in:
Ean Milligan
2025-04-26 16:47:55 -04:00
parent dff1e97186
commit 8483367cb5
8 changed files with 18 additions and 16 deletions

View File

@@ -22,7 +22,7 @@ let currentWorkers = 0;
const rollQueue: Array<ApiQueuedRoll | DDQueuedRoll> = [];
// Handle setting up and calling the rollWorker
const handleRollWorker = async (rq: ApiQueuedRoll | DDQueuedRoll) => {
const handleRollWorker = (rq: ApiQueuedRoll | DDQueuedRoll) => {
currentWorkers++;
// gmModifiers used to create gmEmbed (basically just turn off the gmRoll)
@@ -191,7 +191,7 @@ const handleRollWorker = async (rq: ApiQueuedRoll | DDQueuedRoll) => {
};
// Runs the roll or queues it depending on how many workers are currently running
export const queueRoll = async (rq: ApiQueuedRoll | DDQueuedRoll) => {
export const queueRoll = (rq: ApiQueuedRoll | DDQueuedRoll) => {
if (rq.apiRoll) {
handleRollWorker(rq);
} else if (!rollQueue.length && currentWorkers < config.limits.maxWorkers) {
@@ -215,7 +215,7 @@ The results for this roll will replace this message when it is done.`,
};
// Checks the queue constantly to make sure the queue stays empty
setInterval(async () => {
setInterval(() => {
log(
LT.LOG,
`Checking rollQueue for items, rollQueue length: ${rollQueue.length}, currentWorkers: ${currentWorkers}, config.limits.maxWorkers: ${config.limits.maxWorkers}`