plain.jobs 0.33.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of plain.jobs might be problematic. Click here for more details.
- plain_jobs-0.33.0/.gitignore +16 -0
- plain_jobs-0.33.0/LICENSE +28 -0
- plain_jobs-0.33.0/PKG-INFO +264 -0
- plain_jobs-0.33.0/README.md +1 -0
- plain_jobs-0.33.0/plain/jobs/CHANGELOG.md +186 -0
- plain_jobs-0.33.0/plain/jobs/README.md +253 -0
- plain_jobs-0.33.0/plain/jobs/__init__.py +4 -0
- plain_jobs-0.33.0/plain/jobs/admin.py +238 -0
- plain_jobs-0.33.0/plain/jobs/chores.py +17 -0
- plain_jobs-0.33.0/plain/jobs/cli.py +153 -0
- plain_jobs-0.33.0/plain/jobs/config.py +19 -0
- plain_jobs-0.33.0/plain/jobs/default_settings.py +6 -0
- plain_jobs-0.33.0/plain/jobs/jobs.py +226 -0
- plain_jobs-0.33.0/plain/jobs/middleware.py +20 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0001_initial.py +246 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0002_job_span_id_job_trace_id_jobrequest_span_id_and_more.py +61 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0003_rename_job_jobprocess_and_more.py +80 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0004_rename_tables_to_plainjobs.py +33 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0005_rename_constraints_and_indexes.py +174 -0
- plain_jobs-0.33.0/plain/jobs/migrations/0006_alter_jobprocess_table_alter_jobrequest_table_and_more.py +24 -0
- plain_jobs-0.33.0/plain/jobs/migrations/__init__.py +0 -0
- plain_jobs-0.33.0/plain/jobs/models.py +438 -0
- plain_jobs-0.33.0/plain/jobs/parameters.py +193 -0
- plain_jobs-0.33.0/plain/jobs/registry.py +60 -0
- plain_jobs-0.33.0/plain/jobs/scheduling.py +251 -0
- plain_jobs-0.33.0/plain/jobs/templates/admin/plainqueue/jobresult_detail.html +8 -0
- plain_jobs-0.33.0/plain/jobs/workers.py +322 -0
- plain_jobs-0.33.0/pyproject.toml +23 -0
- plain_jobs-0.33.0/tests/app/settings.py +1 -0
- plain_jobs-0.33.0/tests/test_parameters.py +155 -0
- plain_jobs-0.33.0/tests/test_scheduling.py +156 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023, Dropseed, LLC
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plain.jobs
|
|
3
|
+
Version: 0.33.0
|
|
4
|
+
Summary: Process background jobs with a database-driven job queue.
|
|
5
|
+
Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.13
|
|
8
|
+
Requires-Dist: plain-models<1.0.0
|
|
9
|
+
Requires-Dist: plain<1.0.0
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# plain.jobs
|
|
13
|
+
|
|
14
|
+
**Process background jobs with a database-driven job queue.**
|
|
15
|
+
|
|
16
|
+
- [Overview](#overview)
|
|
17
|
+
- [Local development](#local-development)
|
|
18
|
+
- [Job parameters](#job-parameters)
|
|
19
|
+
- [Job methods](#job-methods)
|
|
20
|
+
- [Scheduled jobs](#scheduled-jobs)
|
|
21
|
+
- [Admin interface](#admin-interface)
|
|
22
|
+
- [Job history](#job-history)
|
|
23
|
+
- [Monitoring](#monitoring)
|
|
24
|
+
- [FAQs](#faqs)
|
|
25
|
+
- [Installation](#installation)
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
Jobs are defined using the [`Job`](./jobs.py#Job) base class and the `run()` method at a minimum.
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from plain.jobs import Job, register_job
|
|
33
|
+
from plain.email import send_mail
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@register_job
|
|
37
|
+
class WelcomeUserJob(Job):
|
|
38
|
+
def __init__(self, user):
|
|
39
|
+
self.user = user
|
|
40
|
+
|
|
41
|
+
def run(self):
|
|
42
|
+
send_mail(
|
|
43
|
+
subject="Welcome!",
|
|
44
|
+
message=f"Hello from Plain, {self.user}",
|
|
45
|
+
from_email="welcome@plainframework.com",
|
|
46
|
+
recipient_list=[self.user.email],
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
You can then create an instance of the job and call [`run_in_worker()`](./jobs.py#Job.run_in_worker) to enqueue it for a background worker to pick up.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
user = User.query.get(id=1)
|
|
54
|
+
WelcomeUserJob(user).run_in_worker()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Workers are run using the `plain jobs worker` command.
|
|
58
|
+
|
|
59
|
+
Jobs can be defined in any Python file, but it is suggested to use `app/jobs.py` or `app/{pkg}/jobs.py` as those will be imported automatically so the [`@register_job`](./registry.py#register_job) decorator will fire.
|
|
60
|
+
|
|
61
|
+
Run database migrations after installation:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
plain migrate
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Local development
|
|
68
|
+
|
|
69
|
+
In development, you will typically want to run the worker alongside your app. With [`plain.dev`](/plain-dev/plain/dev/README.md) you can do this by adding it to the `[tool.plain.dev.run]` section of your `pyproject.toml` file. Currently, you will need to use something like [watchfiles](https://pypi.org/project/watchfiles/) to add auto-reloading to the worker.
|
|
70
|
+
|
|
71
|
+
```toml
|
|
72
|
+
# pyproject.toml
|
|
73
|
+
[tool.plain.dev.run]
|
|
74
|
+
worker = {cmd = "watchfiles --filter python \"plain jobs worker --stats-every 0 --max-processes 2\" ."}
|
|
75
|
+
worker-slow = {cmd = "watchfiles --filter python \"plain jobs worker --queue slow --stats-every 0 --max-processes 2\" ."}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Job parameters
|
|
79
|
+
|
|
80
|
+
When calling `run_in_worker()`, you can specify several parameters to control job execution:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
job.run_in_worker(
|
|
84
|
+
queue="slow", # Target a specific queue (default: "default")
|
|
85
|
+
delay=60, # Delay in seconds (or timedelta/datetime)
|
|
86
|
+
priority=10, # Higher numbers run first (default: 0, use negatives for lower priority)
|
|
87
|
+
retries=3, # Number of retry attempts (default: 0)
|
|
88
|
+
unique_key="user-123-welcome", # Prevent duplicate jobs
|
|
89
|
+
)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For more advanced parameter options, see [`Job.run_in_worker()`](./jobs.py#Job.run_in_worker).
|
|
93
|
+
|
|
94
|
+
## Job methods
|
|
95
|
+
|
|
96
|
+
The [`Job`](./jobs.py#Job) base class provides several methods you can override to customize behavior:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
class MyJob(Job):
|
|
100
|
+
def run(self):
|
|
101
|
+
# Required: The main job logic
|
|
102
|
+
pass
|
|
103
|
+
|
|
104
|
+
def get_queue(self) -> str:
|
|
105
|
+
# Specify the default queue for this job type
|
|
106
|
+
return "default"
|
|
107
|
+
|
|
108
|
+
def get_priority(self) -> int:
|
|
109
|
+
# Set the default priority
|
|
110
|
+
# Higher numbers run first: 10 > 5 > 0 > -5 > -10
|
|
111
|
+
# Use positive numbers for high priority, negative for low priority
|
|
112
|
+
return 0
|
|
113
|
+
|
|
114
|
+
def get_retries(self) -> int:
|
|
115
|
+
# Number of retry attempts on failure
|
|
116
|
+
return 0
|
|
117
|
+
|
|
118
|
+
def get_retry_delay(self, attempt: int) -> int:
|
|
119
|
+
# Delay in seconds before retry (attempt starts at 1)
|
|
120
|
+
return 0
|
|
121
|
+
|
|
122
|
+
def get_unique_key(self) -> str:
|
|
123
|
+
# Return a key to prevent duplicate jobs
|
|
124
|
+
return ""
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Scheduled jobs
|
|
128
|
+
|
|
129
|
+
You can schedule jobs to run at specific times using the [`Schedule`](./scheduling.py#Schedule) class:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from plain.jobs import Job, register_job
|
|
133
|
+
from plain.jobs.scheduling import Schedule
|
|
134
|
+
|
|
135
|
+
@register_job
|
|
136
|
+
class DailyReportJob(Job):
|
|
137
|
+
schedule = Schedule.from_cron("0 9 * * *") # Every day at 9 AM
|
|
138
|
+
|
|
139
|
+
def run(self):
|
|
140
|
+
# Generate daily report
|
|
141
|
+
pass
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The `Schedule` class supports standard cron syntax and special strings:
|
|
145
|
+
|
|
146
|
+
- `@yearly` or `@annually` - Run once a year
|
|
147
|
+
- `@monthly` - Run once a month
|
|
148
|
+
- `@weekly` - Run once a week
|
|
149
|
+
- `@daily` or `@midnight` - Run once a day
|
|
150
|
+
- `@hourly` - Run once an hour
|
|
151
|
+
|
|
152
|
+
For custom schedules, see [`Schedule`](./scheduling.py#Schedule).
|
|
153
|
+
|
|
154
|
+
## Admin interface
|
|
155
|
+
|
|
156
|
+
The jobs package includes admin views for monitoring jobs under the "Jobs" section. The admin interface provides:
|
|
157
|
+
|
|
158
|
+
- **Requests**: View pending jobs in the queue
|
|
159
|
+
- **Processes**: Monitor currently running jobs
|
|
160
|
+
- **Results**: Review completed and failed job history
|
|
161
|
+
|
|
162
|
+
Dashboard cards show at-a-glance statistics for successful, errored, lost, and retried jobs.
|
|
163
|
+
|
|
164
|
+
## Job history
|
|
165
|
+
|
|
166
|
+
Job execution history is stored in the [`JobResult`](./models.py#JobResult) model. This includes:
|
|
167
|
+
|
|
168
|
+
- Job class and parameters
|
|
169
|
+
- Start and end times
|
|
170
|
+
- Success/failure status
|
|
171
|
+
- Error messages and tracebacks for failed jobs
|
|
172
|
+
- Worker information
|
|
173
|
+
|
|
174
|
+
History retention is controlled by the `JOBS_RESULTS_RETENTION` setting (defaults to 7 days):
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
# app/settings.py
|
|
178
|
+
JOBS_RESULTS_RETENTION = 60 * 60 * 24 * 30 # 30 days (in seconds)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Job timeout can be configured with `JOBS_TIMEOUT` (defaults to 1 day):
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
# app/settings.py
|
|
185
|
+
JOBS_TIMEOUT = 60 * 60 * 24 # 1 day (in seconds)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Monitoring
|
|
189
|
+
|
|
190
|
+
Workers report statistics and can be monitored using the `--stats-every` option:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Report stats every 60 seconds
|
|
194
|
+
plain jobs worker --stats-every 60
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The worker integrates with OpenTelemetry for distributed tracing. Spans are created for:
|
|
198
|
+
|
|
199
|
+
- Job scheduling (`run_in_worker`)
|
|
200
|
+
- Job execution
|
|
201
|
+
- Job completion/failure
|
|
202
|
+
|
|
203
|
+
Jobs can be linked to the originating trace context, allowing you to track jobs initiated from web requests.
|
|
204
|
+
|
|
205
|
+
## FAQs
|
|
206
|
+
|
|
207
|
+
#### How do I ensure a job only runs once?
|
|
208
|
+
|
|
209
|
+
Return a unique key from the `get_unique_key()` method:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
class ProcessUserDataJob(Job):
|
|
213
|
+
def __init__(self, user_id):
|
|
214
|
+
self.user_id = user_id
|
|
215
|
+
|
|
216
|
+
def get_unique_key(self):
|
|
217
|
+
return f"process-user-{self.user_id}"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### Can I run multiple workers?
|
|
221
|
+
|
|
222
|
+
Yes, you can run multiple worker processes:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
plain jobs worker --max-processes 4
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Or run workers for specific queues:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
plain jobs worker --queue slow --max-processes 2
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### How do I handle job failures?
|
|
235
|
+
|
|
236
|
+
Set the number of retries and implement retry delays:
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
class MyJob(Job):
|
|
240
|
+
def get_retries(self):
|
|
241
|
+
return 3
|
|
242
|
+
|
|
243
|
+
def get_retry_delay(self, attempt):
|
|
244
|
+
# Exponential backoff: 1s, 2s, 4s
|
|
245
|
+
return 2 ** (attempt - 1)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Installation
|
|
249
|
+
|
|
250
|
+
Install the `plain.jobs` package from [PyPI](https://pypi.org/project/plain.jobs/):
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
uv add plain.jobs
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Add to your `INSTALLED_PACKAGES`:
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
# app/settings.py
|
|
260
|
+
INSTALLED_PACKAGES = [
|
|
261
|
+
...
|
|
262
|
+
"plain.jobs",
|
|
263
|
+
]
|
|
264
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
./plain/jobs/README.md
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# plain-jobs changelog
|
|
2
|
+
|
|
3
|
+
## [0.33.0](https://github.com/dropseed/plain/releases/plain-jobs@0.33.0) (2025-10-10)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Renamed package from `plain.worker` to `plain.jobs` ([24219856e0](https://github.com/dropseed/plain/commit/24219856e0))
|
|
8
|
+
|
|
9
|
+
### Upgrade instructions
|
|
10
|
+
|
|
11
|
+
- Update any imports from `plain.worker` to `plain.jobs` (e.g., `from plain.worker import Job` becomes `from plain.jobs import Job`)
|
|
12
|
+
- Change worker commands from `plain worker run` to `plain jobs worker`
|
|
13
|
+
- Check updated settings names
|
|
14
|
+
|
|
15
|
+
## [0.32.0](https://github.com/dropseed/plain/releases/plain-jobs@0.32.0) (2025-10-07)
|
|
16
|
+
|
|
17
|
+
### What's changed
|
|
18
|
+
|
|
19
|
+
- Models now use `model_options` instead of `_meta` for accessing model configuration like `package_label` and `model_name` ([73ba469](https://github.com/dropseed/plain/commit/73ba469ba0))
|
|
20
|
+
- Model configuration now uses `model_options = models.Options()` instead of `class Meta` ([17a378d](https://github.com/dropseed/plain/commit/17a378dcfb))
|
|
21
|
+
- QuerySet types now properly use `Self` return type for better type checking ([2578301](https://github.com/dropseed/plain/commit/2578301819))
|
|
22
|
+
- Removed unnecessary type ignore comments now that QuerySet is properly typed ([2578301](https://github.com/dropseed/plain/commit/2578301819))
|
|
23
|
+
|
|
24
|
+
### Upgrade instructions
|
|
25
|
+
|
|
26
|
+
- No changes required
|
|
27
|
+
|
|
28
|
+
## [0.31.1](https://github.com/dropseed/plain/releases/plain-jobs@0.31.1) (2025-10-06)
|
|
29
|
+
|
|
30
|
+
### What's changed
|
|
31
|
+
|
|
32
|
+
- Updated dependency resolution to use newer compatible versions of `plain` and `plain.models`
|
|
33
|
+
|
|
34
|
+
### Upgrade instructions
|
|
35
|
+
|
|
36
|
+
- No changes required
|
|
37
|
+
|
|
38
|
+
## [0.31.0](https://github.com/dropseed/plain/releases/plain-jobs@0.31.0) (2025-09-25)
|
|
39
|
+
|
|
40
|
+
### What's changed
|
|
41
|
+
|
|
42
|
+
- The jobs autodiscovery now includes `app.jobs` modules in addition to package jobs modules ([b0b610d](https://github.com/dropseed/plain/commit/b0b610d461))
|
|
43
|
+
|
|
44
|
+
### Upgrade instructions
|
|
45
|
+
|
|
46
|
+
- No changes required
|
|
47
|
+
|
|
48
|
+
## [0.30.0](https://github.com/dropseed/plain/releases/plain-jobs@0.30.0) (2025-09-19)
|
|
49
|
+
|
|
50
|
+
### What's changed
|
|
51
|
+
|
|
52
|
+
- The `Job` model has been renamed to `JobProcess` for better clarity ([986c914](https://github.com/dropseed/plain/commit/986c914))
|
|
53
|
+
- The `job_uuid` field in JobResult has been renamed to `job_process_uuid` to match the model rename ([986c914](https://github.com/dropseed/plain/commit/986c914))
|
|
54
|
+
- Admin interface now shows "Job processes" as the section title instead of "Jobs" ([986c914](https://github.com/dropseed/plain/commit/986c914))
|
|
55
|
+
|
|
56
|
+
### Upgrade instructions
|
|
57
|
+
|
|
58
|
+
- Run `plain migrate` to apply the database migration that renames the Job model to JobProcess
|
|
59
|
+
- If you have any custom code that directly references the `Job` model (different than the `Job` base class for job type definitions), update it to use `JobProcess` instead
|
|
60
|
+
- If you have any code that accesses the `job_uuid` field on JobResult instances, update it to use `job_process_uuid`
|
|
61
|
+
|
|
62
|
+
## [0.29.0](https://github.com/dropseed/plain/releases/plain-jobs@0.29.0) (2025-09-12)
|
|
63
|
+
|
|
64
|
+
### What's changed
|
|
65
|
+
|
|
66
|
+
- Model managers have been renamed from `.objects` to `.query` ([037a239](https://github.com/dropseed/plain/commit/037a239ef4))
|
|
67
|
+
- Manager functionality has been merged into QuerySet classes ([bbaee93](https://github.com/dropseed/plain/commit/bbaee93839))
|
|
68
|
+
- Models now use `Meta.queryset_class` instead of separate manager configuration ([6b60a00](https://github.com/dropseed/plain/commit/6b60a00731))
|
|
69
|
+
|
|
70
|
+
### Upgrade instructions
|
|
71
|
+
|
|
72
|
+
- Update all model queries to use `.query` instead of `.objects` (e.g., `Job.query.all()` becomes `Job.query.all()`)
|
|
73
|
+
|
|
74
|
+
## [0.28.1](https://github.com/dropseed/plain/releases/plain-jobs@0.28.1) (2025-09-10)
|
|
75
|
+
|
|
76
|
+
### What's changed
|
|
77
|
+
|
|
78
|
+
- Fixed log context method in worker middleware to use `include_context` instead of `with_context` ([755f873](https://github.com/dropseed/plain/commit/755f873986))
|
|
79
|
+
|
|
80
|
+
### Upgrade instructions
|
|
81
|
+
|
|
82
|
+
- No changes required
|
|
83
|
+
|
|
84
|
+
## [0.28.0](https://github.com/dropseed/plain/releases/plain-jobs@0.28.0) (2025-09-09)
|
|
85
|
+
|
|
86
|
+
### What's changed
|
|
87
|
+
|
|
88
|
+
- Improved logging middleware to use context manager pattern for cleaner job context handling ([ea7c953](https://github.com/dropseed/plain/commit/ea7c9537e3))
|
|
89
|
+
- Updated minimum Python requirement to 3.13 ([d86e307](https://github.com/dropseed/plain/commit/d86e307efb))
|
|
90
|
+
- Added explicit nav_icon definitions to admin views to ensure consistent icon display ([2aac07d](https://github.com/dropseed/plain/commit/2aac07de4e))
|
|
91
|
+
|
|
92
|
+
### Upgrade instructions
|
|
93
|
+
|
|
94
|
+
- No changes required
|
|
95
|
+
|
|
96
|
+
## [0.27.1](https://github.com/dropseed/plain/releases/plain-jobs@0.27.1) (2025-08-27)
|
|
97
|
+
|
|
98
|
+
### What's changed
|
|
99
|
+
|
|
100
|
+
- Jobs are now marked as cancelled when the worker process is killed or fails unexpectedly ([e73ca53](https://github.com/dropseed/plain/commit/e73ca53c3d))
|
|
101
|
+
|
|
102
|
+
### Upgrade instructions
|
|
103
|
+
|
|
104
|
+
- No changes required
|
|
105
|
+
|
|
106
|
+
## [0.27.0](https://github.com/dropseed/plain/releases/plain-jobs@0.27.0) (2025-08-22)
|
|
107
|
+
|
|
108
|
+
### What's changed
|
|
109
|
+
|
|
110
|
+
- Added support for date and datetime job parameters with proper serialization/deserialization ([7bb5ab0911](https://github.com/dropseed/plain/commit/7bb5ab0911))
|
|
111
|
+
- Improved job priority documentation to clarify that higher numbers run first ([73271b5bf0](https://github.com/dropseed/plain/commit/73271b5bf0))
|
|
112
|
+
- Updated admin interface with consolidated navigation icons at the section level ([5a6479ac79](https://github.com/dropseed/plain/commit/5a6479ac79))
|
|
113
|
+
- Enhanced admin views to use cached object properties for better performance ([bd0507a72c](https://github.com/dropseed/plain/commit/bd0507a72c))
|
|
114
|
+
|
|
115
|
+
### Upgrade instructions
|
|
116
|
+
|
|
117
|
+
- No changes required
|
|
118
|
+
|
|
119
|
+
## [0.26.0](https://github.com/dropseed/plain/releases/plain-jobs@0.26.0) (2025-08-19)
|
|
120
|
+
|
|
121
|
+
### What's changed
|
|
122
|
+
|
|
123
|
+
- Improved CSRF token handling in admin forms by removing manual `csrf_input` in favor of automatic Sec-Fetch-Site header validation ([955150800c](https://github.com/dropseed/plain/commit/955150800c))
|
|
124
|
+
- Enhanced README documentation with comprehensive examples, table of contents, and detailed sections covering job parameters, scheduling, monitoring, and FAQs ([4ebecd1856](https://github.com/dropseed/plain/commit/4ebecd1856))
|
|
125
|
+
- Updated package description to be more descriptive: "Process background jobs with a database-driven worker" ([4ebecd1856](https://github.com/dropseed/plain/commit/4ebecd1856))
|
|
126
|
+
|
|
127
|
+
### Upgrade instructions
|
|
128
|
+
|
|
129
|
+
- No changes required
|
|
130
|
+
|
|
131
|
+
## [0.25.1](https://github.com/dropseed/plain/releases/plain-jobs@0.25.1) (2025-07-23)
|
|
132
|
+
|
|
133
|
+
### What's changed
|
|
134
|
+
|
|
135
|
+
- Added Bootstrap icons to admin interface for worker job views ([9e9f8b0](https://github.com/dropseed/plain/commit/9e9f8b0e2ccc3174f05034e6e908bb26345e1a5c))
|
|
136
|
+
- Removed the description field from admin views ([8d2352d](https://github.com/dropseed/plain/commit/8d2352db94277ddd87b6a480783c9f740b6e806f))
|
|
137
|
+
|
|
138
|
+
### Upgrade instructions
|
|
139
|
+
|
|
140
|
+
- No changes required
|
|
141
|
+
|
|
142
|
+
## [0.25.0](https://github.com/dropseed/plain/releases/plain-jobs@0.25.0) (2025-07-22)
|
|
143
|
+
|
|
144
|
+
### What's changed
|
|
145
|
+
|
|
146
|
+
- Removed `pk` alias and auto fields in favor of a single automatic `id` PrimaryKeyField ([4b8fa6a](https://github.com/dropseed/plain/commit/4b8fa6aef126a15e48b5f85e0652adf841eb7b5c))
|
|
147
|
+
- Admin interface methods now use `target_ids` parameter instead of `target_pks` for batch actions
|
|
148
|
+
- Model instance registry now uses `.id` instead of `.pk` for Global ID generation
|
|
149
|
+
- Updated database migrations to use `models.PrimaryKeyField()` instead of `models.BigAutoField()`
|
|
150
|
+
|
|
151
|
+
### Upgrade instructions
|
|
152
|
+
|
|
153
|
+
- No changes required
|
|
154
|
+
|
|
155
|
+
## [0.24.0](https://github.com/dropseed/plain/releases/plain-jobs@0.24.0) (2025-07-18)
|
|
156
|
+
|
|
157
|
+
### What's changed
|
|
158
|
+
|
|
159
|
+
- Added OpenTelemetry tracing support to job processing system ([b0224d0](https://github.com/dropseed/plain/commit/b0224d0418))
|
|
160
|
+
- Job requests now capture trace context when queued from traced operations
|
|
161
|
+
- Job execution creates proper consumer spans linked to the original producer trace
|
|
162
|
+
- Added `trace_id` and `span_id` fields to JobRequest, Job, and JobResult models for trace correlation
|
|
163
|
+
|
|
164
|
+
### Upgrade instructions
|
|
165
|
+
|
|
166
|
+
- Run `plain migrate` to apply new database migration that adds trace context fields to worker tables
|
|
167
|
+
|
|
168
|
+
## [0.23.0](https://github.com/dropseed/plain/releases/plain-jobs@0.23.0) (2025-07-18)
|
|
169
|
+
|
|
170
|
+
### What's changed
|
|
171
|
+
|
|
172
|
+
- Migrations have been reset and consolidated into a single initial migration ([484f1b6e93](https://github.com/dropseed/plain/commit/484f1b6e93))
|
|
173
|
+
|
|
174
|
+
### Upgrade instructions
|
|
175
|
+
|
|
176
|
+
- Run `plain migrate --prune plainworker` to remove old migration records and apply the consolidated migration
|
|
177
|
+
|
|
178
|
+
## [0.22.5](https://github.com/dropseed/plain/releases/plain-jobs@0.22.5) (2025-06-24)
|
|
179
|
+
|
|
180
|
+
### What's changed
|
|
181
|
+
|
|
182
|
+
- No functional changes. This release only updates internal documentation (CHANGELOG) and contains no code modifications that impact users ([82710c3](https://github.com/dropseed/plain/commit/82710c3), [9a1963d](https://github.com/dropseed/plain/commit/9a1963d), [e1f5dd3](https://github.com/dropseed/plain/commit/e1f5dd3)).
|
|
183
|
+
|
|
184
|
+
### Upgrade instructions
|
|
185
|
+
|
|
186
|
+
- No changes required
|