Skip to content

Commit 8135abd

Browse files
javier-aliagamsfussellJoshVanLcicoyle
authored
docs: add jobs overwrite flag (#4646)
* docs: add jobs overwrite flag Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/reference/api/jobs_api.md Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> * docs: Rewrite job-overview features Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md Co-authored-by: Josh van Leeuwen <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-overview.md Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-overview.md Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Javier Aliaga <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-overview.md Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: Javier Aliaga <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Mark Fussell <[email protected]> Co-authored-by: Josh van Leeuwen <[email protected]> Co-authored-by: Cassie Coyle <[email protected]>
1 parent 52bd01f commit 8135abd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ All jobs are registered with a case-sensitive job name. These names are intended
1919
interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as
2020
to indicate which job a triggered invocation is associated with.
2121

22-
Only one job can be associated with a name at any given time. Any attempt to create a new job using the same name
23-
as an existing job will result in an overwrite of this existing job.
22+
Only one job can be associated with a name at any given time. By default, any attempt to create a new job using the same name as an existing job results in an error. However, if the `overwrite` flag is set to `true`, the new job overwrites the existing job with the same name.
2423

2524
## Scheduling Jobs
2625
A job can be scheduled using any of the following mechanisms:
@@ -115,6 +114,7 @@ POST request to the endpoint `/job/<job-name>`. The body includes the following
115114
or the not-before time from which the schedule should take effect
116115
- `Ttl`: An optional value indicating when the job should expire
117116
- `Payload`: A collection of bytes containing data originally stored when the job was scheduled
117+
- `Overwrite`: A flag to allow the requested job to overwrite an existing job with the same name, if it already exists.
118118

119119
The `DueTime` and `Ttl` fields will reflect an RC3339 timestamp value reflective of the time zone provided when the job was
120120
originally scheduled. If no time zone was provided, these values indicate the time zone used by the server running

daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Dapr's jobs API ensures the tasks represented in these scenarios are performed c
5353

5454
## Features
5555

56-
The jobs API provides several features to make it easy for you to schedule jobs.
56+
The main functionality of the Jobs API allows you to create, retrieve, and delete scheduled jobs. By default, when you create a job with a name that already exists, the operation fails unless you explicitly set the `overwrite` flag to `true`. This ensures that existing jobs are not accidentally modified or overwritten.
5757

5858
### Schedule jobs across multiple replicas
5959

60-
When you create a job, it replaces any existing job with the same name. This means that every time a job is created, it resets the count and only keeps 1 record in the embedded etcd for that job. Therefore, you don't need to worry about multiple jobs being created and firing off — only the most recent job is recorded and executed, even if all your apps schedule the same job on startup.
60+
When you create a job, it does not replace an existing job with the same name, unless you explicitly set the `overwrite` flag. This means that every time a job is created, it resets the count and only keeps 1 record in the embedded etcd for that job. Therefore, you don't need to worry about multiple jobs being created and firing off — only the most recent job is recorded and executed, even if all your apps schedule the same job on startup.
6161

6262
The Scheduler service enables the scheduling of jobs to scale across multiple replicas, while guaranteeing that a job is only triggered by 1 Scheduler service instance.
6363

daprdocs/content/en/reference/api/jobs_api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Parameter | Description
3737
`dueTime` | An optional time at which the job should be active, or the "one shot" time, if other scheduling type fields are not provided. Accepts a "point in time" string in the format of RFC3339, Go duration string (calculated from creation time), or non-repeating ISO8601.
3838
`repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration.
3939
`ttl` | An optional time to live or expiration of the job. Accepts a "point in time" string in the format of RFC3339, Go duration string (calculated from job creation time), or non-repeating ISO8601.
40+
`overwrite` | A boolean value to specify if the job can overwrite an existing one with the same name. Default value is `false`
4041

4142
#### schedule
4243
`schedule` accepts both systemd timer-style cron expressions, as well as human readable '@' prefixed period strings, as defined below.

0 commit comments

Comments
 (0)