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
Unlike [services](#services), custom processes are _only_ run during `plain dev`. This is a good place to run something like [ngrok](https://ngrok.com/) or a [Plain worker](../../../plain-worker), which you might need to use your local site, but don't need running for executing tests, for example.
64
+
Unlike [services](#services), custom processes are _only_ run during `plain dev`. This is a good place to run something like [ngrok](https://ngrok.com/) or a [Plain job worker](../../../plain-jobs), which you might need to use your local site, but don't need running for executing tests, for example.
Copy file name to clipboardExpand all lines: plain-jobs/plain/jobs/README.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# plain.worker
1
+
# plain.jobs
2
2
3
-
**Process background jobs with a database-driven worker.**
3
+
**Process background jobs with a database-driven job queue.**
4
4
5
5
-[Overview](#overview)
6
6
-[Local development](#local-development)
@@ -18,7 +18,7 @@
18
18
Jobs are defined using the [`Job`](./jobs.py#Job) base class and the `run()` method at a minimum.
19
19
20
20
```python
21
-
from plain.workerimport Job, register_job
21
+
from plain.jobsimport Job, register_job
22
22
from plain.email import send_mail
23
23
24
24
@@ -43,7 +43,7 @@ user = User.query.get(id=1)
43
43
WelcomeUserJob(user).run_in_worker()
44
44
```
45
45
46
-
Workers are run using the `plain worker run` command.
46
+
Workers are run using the `plain jobs worker` command.
47
47
48
48
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.
49
49
@@ -60,8 +60,8 @@ In development, you will typically want to run the worker alongside your app. Wi
0 commit comments