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

Commit 8ec602b

Browse files
committed
add resource defaults.
1 parent 11d6a74 commit 8ec602b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/jobs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import { jobDefinition, JobContext } from '@nitric/sdk'
5454

5555
const myJob = jobDefinition('analyse').define((ctx: JobContext) => {
5656
// Do some work
57-
})
57+
}, {cpus: 1, memory: 1024, gpus: 0})
5858
```
5959
6060
```python
@@ -63,7 +63,7 @@ from nitric.application import Nitric
6363
from nitric.context import JobContext
6464

6565
# Define will allow the developer to fine-tune the job option, such as adding resource dependencies (e.g. CPU, Memory, GPUs) etc.
66-
@job_definition("analyse").define()
66+
@job_definition("analyse").define(cpus=1, memory=1024, gpus=0)
6767
async def generate_image(ctx: None):
6868
# Do some work
6969

0 commit comments

Comments
 (0)