Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit 2fc87b7

Browse files
committed
Move the modelSlug variable to toplevel
Avoids the problem of sending out "null" on error.
1 parent 3c9bfdf commit 2fc87b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/model-runner/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { enforceRunnerInputSchema, enforceOutputSchema } from './schema'
2323

2424
let inputID: string | number | null = null
2525
let callbackURL: string | null = null
26-
const modelSlug: ModelSlug | null = null
26+
let modelSlug: ModelSlug | null = null
2727

2828
const handleRejection: NodeJS.UnhandledRejectionListener = err => {
2929
const finalLogger = pino.final(logger)
@@ -55,11 +55,11 @@ async function main() {
5555

5656
enforceRunnerInputSchema(input)
5757

58-
inputID = input.id
59-
callbackURL = input.callbackURL
6058
logger.info(JSON.stringify(input))
6159
const model = input.models.shift()
62-
const modelSlug = model.slug
60+
inputID = input.id
61+
callbackURL = input.callbackURL
62+
modelSlug = model.slug
6363
const dockerImage = model.imageURL
6464

6565
// Notify the UI that the simulation is starting.

0 commit comments

Comments
 (0)