From e86c7ec65a65a1b8d73c5981ca8636aee49f496b Mon Sep 17 00:00:00 2001 From: Javier Aliaga Date: Wed, 7 May 2025 15:51:52 +0200 Subject: [PATCH] docs: add jobs overwrite flag Signed-off-by: Javier Aliaga --- .../building-blocks/jobs/jobs-features-concepts.md | 4 ++-- daprdocs/content/en/reference/api/jobs_api.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md index 0d528f2c0..4a5b76690 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md @@ -19,8 +19,7 @@ All jobs are registered with a case-sensitive job name. These names are intended interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as to indicate which job a triggered invocation is associated with. -Only one job can be associated with a name at any given time. Any attempt to create a new job using the same name -as an existing job will result in an overwrite of this existing job. +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 will result in an error. However, if the `overwrite` flag is set to `true`, the new job will overwrite the existing job with the same name. ## Scheduling Jobs A job can be scheduled using any of the following mechanisms: @@ -115,6 +114,7 @@ POST request to the endpoint `/job/`. The body includes the following or the not-before time from which the schedule should take effect - `Ttl`: An optional value indicating when the job should expire - `Payload`: A collection of bytes containing data originally stored when the job was scheduled +- `Overwrite`: An optional flag to allow the job to overwrite an existing job with the same name The `DueTime` and `Ttl` fields will reflect an RC3339 timestamp value reflective of the time zone provided when the job was originally scheduled. If no time zone was provided, these values indicate the time zone used by the server running diff --git a/daprdocs/content/en/reference/api/jobs_api.md b/daprdocs/content/en/reference/api/jobs_api.md index bb635e3c7..b51458429 100644 --- a/daprdocs/content/en/reference/api/jobs_api.md +++ b/daprdocs/content/en/reference/api/jobs_api.md @@ -37,6 +37,7 @@ Parameter | Description `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. `repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration. `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. +`overwrite` | A boolean value to specify it the job can overwrite an existing one. Default value is `false` #### schedule `schedule` accepts both systemd timer-style cron expressions, as well as human readable '@' prefixed period strings, as defined below.