Unify error handling

This commit is contained in:
Snarling
2022-08-29 02:41:17 -04:00
parent 5798c4c7d3
commit 572c68738f
23 changed files with 156 additions and 255 deletions
+2 -3
View File
@@ -12,7 +12,6 @@ import { GetServer } from "../Server/AllServers";
import { errorDialog } from "../ui/React/DialogBox";
import { AddRecentScript } from "./RecentScripts";
import { Player } from "../Player";
import { ITutorial } from "../InteractiveTutorial";
import { AlertEvents } from "../ui/React/AlertManager";
@@ -102,8 +101,8 @@ function removeWorkerScript(workerScript: WorkerScript): void {
// Recalculate ram used on that server
server.updateRamUsed(0, Player);
for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads, Player);
server.updateRamUsed(0);
for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads);
// Delete script from global pool (workerScripts)
workerScripts.delete(workerScript.pid);