You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 13/umbraco-cms/reference/scheduling.md
+45-32Lines changed: 45 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,52 +12,65 @@ Once you have created your background job class, register it using a Composer. I
12
12
Be aware you may or may not want this background job to run on all servers. If you are using Load Balancing with multiple servers, see [load balancing documentation](../fundamentals/setup/server-setup/load-balancing/) for more information
13
13
{% endhint %}
14
14
15
-
## `IRecurringBackgroundJob`
15
+
## `IRecurringBackgroundJob` Properties and Methods
16
16
17
-
-`Period` - this property is a `TimeSpan` that tells Umbraco how often to run your job.
17
+
### Period
18
18
19
-
```c#
20
-
// Run this job every 5 minutes
21
-
TimeSpanPeriod=TimeSpan.FromMinutes(5);
22
-
```
19
+
Defines how often the job runs. This property is a `TimeSpan`.
Specifies a list of roles that should run this job. In a multi-server setup, you may want your job to run on _all_ servers or only on _one_ of your servers.
42
38
43
-
- `PeriodChanged` -aneventyoucantriggertotellthebackgroundjobservicethattheperiodhaschanged. Forexample, iftheperiodfor your job is controlled by a configuration file setting.
39
+
For example, a temporary file cleanup task might need to run on all servers. A database import job might be better to be run once per day on a single server.
44
40
45
-
```c#
46
-
// No-op event as the period never changes on this job
For more information about server roles, see the [Load Balancing](../fundamentals/setup/server-setup/load-balancing/README.md#scheduling-and-server-role-election) documentation.
53
49
54
-
```c#
55
-
publicTaskRunJobAsync() {
56
-
// your job code goes here
57
-
}
58
-
```
50
+
### PeriodChanged
51
+
52
+
An event used to notify the background job service if the job’s period changes dynamically.
53
+
54
+
For example, if the period for your job is controlled by a configuration file setting, you can trigger the `PeriodChanged` event when the configuration changes.
55
+
56
+
```csharp
57
+
// No-op event as the period never changes on this job
Copy file name to clipboardExpand all lines: 14/umbraco-cms/reference/scheduling.md
+45-32Lines changed: 45 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,52 +12,65 @@ Once you have created your background job class, register it using a Composer. I
12
12
Be aware you may or may not want this background job to run on all servers. If you are using Load Balancing with multiple servers, see [load balancing documentation](../fundamentals/setup/server-setup/load-balancing/) for more information
13
13
{% endhint %}
14
14
15
-
## `IRecurringBackgroundJob`
15
+
## `IRecurringBackgroundJob` Properties and Methods
16
16
17
-
-`Period` - this property is a `TimeSpan` that tells Umbraco how often to run your job.
17
+
### Period
18
18
19
-
```c#
20
-
// Run this job every 5 minutes
21
-
TimeSpanPeriod=TimeSpan.FromMinutes(5);
22
-
```
19
+
Defines how often the job runs. This property is a `TimeSpan`.
Specifies a list of roles that should run this job. In a multi-server setup, you may want your job to run on _all_ servers or only on _one_ of your servers.
42
38
43
-
- `PeriodChanged` -aneventyoucantriggertotellthebackgroundjobservicethattheperiodhaschanged. Forexample, iftheperiodfor your job is controlled by a configuration file setting.
39
+
For example, a temporary file cleanup task might need to run on all servers. A database import job might be better to be run once per day on a single server.
44
40
45
-
```c#
46
-
// No-op event as the period never changes on this job
For more information about server roles, see the [Load Balancing](../fundamentals/setup/server-setup/load-balancing/README.md#scheduling-and-server-role-election) documentation.
53
49
54
-
```c#
55
-
publicTaskRunJobAsync() {
56
-
// your job code goes here
57
-
}
58
-
```
50
+
### PeriodChanged
51
+
52
+
An event used to notify the background job service if the job’s period changes dynamically.
53
+
54
+
For example, if the period for your job is controlled by a configuration file setting, you can trigger the `PeriodChanged` event when the configuration changes.
55
+
56
+
```csharp
57
+
// No-op event as the period never changes on this job
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/scheduling.md
+45-32Lines changed: 45 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,52 +12,65 @@ Once you have created your background job class, register it using a Composer. I
12
12
Be aware you may or may not want this background job to run on all servers. If you are using Load Balancing with multiple servers, see [load balancing documentation](../fundamentals/setup/server-setup/load-balancing/) for more information
13
13
{% endhint %}
14
14
15
-
## `IRecurringBackgroundJob`
15
+
## `IRecurringBackgroundJob` Properties and Methods
16
16
17
-
-`Period` - this property is a `TimeSpan` that tells Umbraco how often to run your job.
17
+
### Period
18
18
19
-
```c#
20
-
// Run this job every 5 minutes
21
-
TimeSpanPeriod=TimeSpan.FromMinutes(5);
22
-
```
19
+
Defines how often the job runs. This property is a `TimeSpan`.
Specifies a list of roles that should run this job. In a multi-server setup, you may want your job to run on _all_ servers or only on _one_ of your servers.
42
38
43
-
- `PeriodChanged` -aneventyoucantriggertotellthebackgroundjobservicethattheperiodhaschanged. Forexample, iftheperiodfor your job is controlled by a configuration file setting.
39
+
For example, a temporary file cleanup task might need to run on all servers. A database import job might be better to be run once per day on a single server.
44
40
45
-
```c#
46
-
// No-op event as the period never changes on this job
For more information about server roles, see the [Load Balancing](../fundamentals/setup/server-setup/load-balancing/README.md#scheduling-and-server-role-election) documentation.
53
49
54
-
```c#
55
-
publicTaskRunJobAsync() {
56
-
// your job code goes here
57
-
}
58
-
```
50
+
### PeriodChanged
51
+
52
+
An event used to notify the background job service if the job’s period changes dynamically.
53
+
54
+
For example, if the period for your job is controlled by a configuration file setting, you can trigger the `PeriodChanged` event when the configuration changes.
55
+
56
+
```csharp
57
+
// No-op event as the period never changes on this job
0 commit comments