Skip to content

Commit 1fd1d26

Browse files
committed
Made jobs and runs into nouns
1 parent 6979eb6 commit 1fd1d26

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed
+17-17
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: "Managing Jobs"
3-
description: "Managing jobs in your codebase and the dashboard"
3+
description: "Managing Jobs in your codebase and the dashboard"
44
---
55

6-
## Disabling jobs
6+
## Disabling Jobs
77

8-
To prevent a job from processing new runs, you can disable it by setting the `enabled` option:
8+
To prevent a Job from processing new Runs, you can disable it by setting the `enabled` option:
99

1010
```ts
1111
client.defineJob({
@@ -15,29 +15,29 @@ client.defineJob({
1515
trigger: eventTrigger({ name: "example.event" }),
1616
enabled: false,
1717
run: async (payload, io, ctx) => {
18-
// your job code here
18+
// your Job code here
1919
},
2020
});
2121
```
2222

2323
If you omit the `enabled` option, it will default to `true`.
2424

25-
The job will only be disabled in environments that have seen the `enabled = false` value. So the job will remain enabled in production until the code with the `enabled = false` is deployed to production.
25+
The Job will only be disabled in environments that have seen the `enabled = false` value. So the Job will remain enabled in production until the code with the `enabled = false` is deployed to production.
2626

2727
<Note>
28-
Currently this is the only way to disable a job. If you'd like to disable a job in the Dashboard,
28+
Currently this is the only way to disable a Job. If you'd like to disable a Job in the Dashboard,
2929
please reach out to us on [Discord](https://discord.gg/kA47vcd8P6) and let us know 👋
3030
</Note>
3131

32-
Once a job is disabled no **new** runs will be created for that job, and it will still be visible in the Dashboard as disabled:
32+
Once a Job is disabled no **new** Runs will be created for that Job, and it will still be visible in the Dashboard as disabled:
3333

3434
![Disabled Job](/images/disabled-job.png)
3535

36-
### In-progress runs
36+
### In-progress Runs
3737

38-
In-progress runs will be allowed to finish, even runs that are currently delayed from a call to `io.wait`. If you'd like to completely stop in-progress runs, you have two options:
38+
In-progress Runs will be allowed to finish, even Runs that are currently delayed from a call to `io.wait`. If you'd like to completely stop in-progress Runs, you have two options:
3939

40-
- Set the `enabled` option to false and then `throw` an error at the top of your job `run` function.
40+
- Set the `enabled` option to false and then `throw` an error at the top of your Job `run` function.
4141

4242
```ts
4343
client.defineJob({
@@ -52,11 +52,11 @@ client.defineJob({
5252
});
5353
```
5454

55-
- Delete the job from your codebase. This will disable the job as well but also stop in progress runs.
55+
- Delete the Job from your codebase. This will disable the Job as well but also stop in progress Runs.
5656

5757
### Disabling in production with env vars
5858

59-
You can easily disable jobs in production using env vars so you don't have to deploy new code to disable a job.
59+
You can easily disable Jobs in production using env vars so you don't have to deploy new code to disable a Job.
6060

6161
```ts
6262
client.defineJob({
@@ -66,19 +66,19 @@ client.defineJob({
6666
trigger: eventTrigger({ name: "example.event" }),
6767
enabled: process.env.TRIGGER_JOBS_DISABLED === "true",
6868
run: async (payload, io, ctx) => {
69-
// your job code here
69+
// your Job code here
7070
},
7171
});
7272
```
7373

74-
Then you can disable the job in production by setting the `TRIGGER_JOBS_DISABLED` env var to `"true"`. And removing the env var will re-enable the job.
74+
Then you can disable the Job in production by setting the `TRIGGER_JOBS_DISABLED` env var to `"true"`. And removing the env var will re-enable the Job.
7575

76-
## Deleting jobs
76+
## Deleting Jobs
7777

78-
Once you have disabled a job in all environments, you can delete it from the dashboard by navigating to the Job list page and clicking the "triple-dot" menu next to the job you want to delete:
78+
Once you have disabled a Job in all environments, you can delete it from the dashboard by navigating to the Job list page and clicking the "triple-dot" menu next to the Job you want to delete:
7979

8080
![Job Menu](/images/job-triple-dot-menu.png)
8181

82-
This will bring up a dialog confirming that you want to delete the job and all of its history:
82+
This will bring up a dialog confirming that you want to delete the Job and all of its history:
8383

8484
![Delete Job Dialog](/images/delete-job.png)

0 commit comments

Comments
 (0)