-
Notifications
You must be signed in to change notification settings - Fork 5
Web interviews #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
57050a3
cb4bd35
945382a
c100469
d076690
0a671f1
aa643c9
630dc13
f922d97
d97180d
e62d8df
69a9355
a5e6f97
174f3ff
ffd7636
fa911bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,15 +25,34 @@ export class CodeRunService { | |
| // this.ctx.executionCtx.waitUntil(roomDo.handleCodeExecutioMessage({ type: 'start' })); | ||
|
|
||
| const sandbox = await this.getSandbox(roomId); | ||
| const raw = await sandbox.runCode({ language, code }); | ||
| const result = formatExecOutput(raw); | ||
|
|
||
| // // Broadcast execution complete | ||
| // this.ctx.executionCtx.waitUntil( | ||
| // roomDo.handleCodeExecutioMessage({ type: 'complete', output: result?.stdout || result?.stderr || 'No output from execution' }), | ||
| // ); | ||
|
|
||
| return result; | ||
| try { | ||
| const raw = await sandbox.runCode({ language, code }); | ||
|
|
||
| const result = formatExecOutput(raw); | ||
| return result; | ||
| } catch (error) { | ||
| console.error('error', error); | ||
| return { | ||
| success: false, | ||
| timestamp: new Date().toISOString(), | ||
| stdout: '', | ||
| stderr: 'Error running code', | ||
| exitCode: 1, | ||
| elapsedTime: -1, | ||
| compileTime: undefined, | ||
| }; | ||
| } | ||
|
|
||
| // throw new Error('test'); | ||
| // console.log('result', result); | ||
|
|
||
| // // // Broadcast execution complete | ||
| // // this.ctx.executionCtx.waitUntil( | ||
| // // roomDo.handleCodeExecutioMessage({ type: 'complete', output: result?.stdout || result?.stderr || 'No output from execution' }), | ||
| // // ); | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Error Masking and Debug Line LeakThe |
||
| // return result; | ||
| } | ||
|
|
||
| private async getSandbox(roomId: Id<'room'>) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| { | ||
| "$schema": "../../node_modules/@biomejs/biome/configuration_schema.json", | ||
| "extends": "//", | ||
| "root": false, | ||
| "files": { | ||
| "includes": ["src/**/*.ts", "src/**/*.tsx", "!src/routeTree.gen.ts"] | ||
| }, | ||
| "extends": ["../../biome.json"] | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.