Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 4baaa53

Browse files
tjholmjyecusch
authored andcommitted
update nodejs handler docs
1 parent 55602d8 commit 4baaa53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pages/reference/nodejs/batch/job-handler.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { job, JobContext } from '@nitric/sdk'
1010

1111
const analyse = job('analyse')
1212

13-
analyse.handler({ cpus: 1, memory: 1024, gpus: 0 }, async (ctx: JobContext) => {
13+
analyse.handler(async (ctx: JobContext) => {
1414
// Do some work
1515
return ctx
16-
})
16+
}, { cpus: 1, memory: 1024, gpus: 0 })
1717
```
1818

1919
## Defining Batches
@@ -55,7 +55,7 @@ import { job, JobContext } from '@nitric/sdk'
5555

5656
const analyse = job('analyse')
5757

58-
analyse.handler({}, async (ctx: JobContext) => {
58+
analyse.handler(async (ctx: JobContext) => {
5959
// Do some work
6060
return ctx
6161
})
@@ -68,8 +68,8 @@ import { job, JobContext } from '@nitric/sdk'
6868

6969
const analyse = job('analyse')
7070

71-
analyse.handler({ cpus: 1, memory: 2048, gpus: 0 }, async (ctx: JobContext) => {
71+
analyse.handler(async (ctx: JobContext) => {
7272
// Do some work
7373
return ctx
74-
})
74+
}, { cpus: 1, memory: 2048, gpus: 0 })
7575
```

0 commit comments

Comments
 (0)