From a2c78aad86c4d82b55fd6941aaae1c3c1b68f5d2 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 9 Jul 2023 21:45:07 -0700 Subject: [PATCH] move logic to backend --- src/PreviewManager.ts | 3 --- src/toAREPLLogic.ts | 13 ------------- 2 files changed, 16 deletions(-) diff --git a/src/PreviewManager.ts b/src/PreviewManager.ts index b9c1c03..ab06710 100644 --- a/src/PreviewManager.ts +++ b/src/PreviewManager.ts @@ -221,14 +221,12 @@ export default class PreviewManager { // basically all this does is load a file.. why does it need to be async *sob* const env = await this.loadAndWatchEnvVars() - // start three evaluators and save them to dict by name this.PythonEvaluator = new PythonEvaluator({ pythonOptions, pythonPath, env, }) - // put below two in a loop for each evaluator try { console.log('Starting python with path ' + pythonPath) this.PythonEvaluator.start() @@ -259,7 +257,6 @@ export default class PreviewManager { }) this.PythonEvaluator.pyshell.childProcess.on("exit", err => { // might need to rethink this method now that i kill arepl on purpose... - if(!err) return // normal exit console.debug('exit handler invoked w/ ' + err) this.previewContainer.displayProcessError(`err code: ${err}`); this.reporter.sendError(new Error('exit'), err, 'spawn') diff --git a/src/toAREPLLogic.ts b/src/toAREPLLogic.ts index 5158fdc..dac33c6 100644 --- a/src/toAREPLLogic.ts +++ b/src/toAREPLLogic.ts @@ -84,19 +84,6 @@ export class ToAREPLLogic{ // while typing syntaxPromise = this.PythonEvaluator.checkSyntax(data.savedCode + data.evalCode) syntaxPromise.then(() => { - // to check for free executor: - // freeEvaluator = evaluators.first(evaluator=>evaluator.free) - - // cancel setinterval - // restart all Executing or DirtyFree processes - // if no freshfree executor: - setInterval(()=>{ - // if free executor, send code - }, 60) - // else: send code to first free executor - // send code func: - // foo.execCode(data) - // set last ran executor this.PythonEvaluator.execCode(data) }) .catch((error: NodeJS.ErrnoException|string) => {