-
-
Notifications
You must be signed in to change notification settings - Fork 110
Add result to jobs #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add result to jobs #1502
Changes from 4 commits
e3dc095
a940c04
218e390
d495df3
3a6c15e
826633e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,12 @@ | |||||||||||||||||||||||
| [](https://github.com/procrastinate-org/procrastinate/blob/main/CODE_OF_CONDUCT.md) | ||||||||||||||||||||||||
| [](https://discord.gg/JWZeNq6P6Z) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| **Procrastinate is looking for** [additional maintainers!](https://github.com/procrastinate-org/procrastinate/discussions/748) | ||||||||||||||||||||||||
| ### Fork changes | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| 1. Added `result` column to `jobs` table so failed job can store it's failure reason | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| **Procrastinate is looking for | ||||||||||||||||||||||||
| ** [additional maintainers!](https://github.com/procrastinate-org/procrastinate/discussions/748) | ||||||||||||||||||||||||
|
Comment on lines
+13
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix heading level and malformed bold markdown. Two issues:
📝 Suggested fix-### Fork changes
+## Fork changes
1. Added `result` column to `jobs` table so failed job can store it's failure reason
-**Procrastinate is looking for
-** [additional maintainers!](https://github.com/procrastinate-org/procrastinate/discussions/748)
+**Procrastinate is looking for [additional maintainers!](https://github.com/procrastinate-org/procrastinate/discussions/748)**📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[style] ~18-~18: Using many exclamation marks might seem excessive (in this case: 8 exclamation marks for a text that’s 3189 characters long) (EN_EXCESSIVE_EXCLAMATION) 🪛 markdownlint-cli2 (0.20.0)[warning] 13-13: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Procrastinate is an open-source Python 3.10+ distributed task processing | ||||||||||||||||||||||||
| library, leveraging PostgreSQL 13+ to store task definitions, manage locks and | ||||||||||||||||||||||||
|
|
@@ -31,12 +36,14 @@ import procrastinate | |||||||||||||||||||||||
| # Make an app in your code | ||||||||||||||||||||||||
| app = procrastinate.App(connector=procrastinate.SyncPsycopgConnector()) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Then define tasks | ||||||||||||||||||||||||
| @app.task(queue="sums") | ||||||||||||||||||||||||
| def sum(a, b): | ||||||||||||||||||||||||
| with open("myfile", "w") as f: | ||||||||||||||||||||||||
| f.write(str(a + b)) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| with app.open(): | ||||||||||||||||||||||||
| # Launch a job | ||||||||||||||||||||||||
| sum.defer(a=3, b=5) | ||||||||||||||||||||||||
|
|
@@ -72,11 +79,13 @@ import procrastinate | |||||||||||||||||||||||
| # Make an app in your code | ||||||||||||||||||||||||
| app = procrastinate.App(connector=procrastinate.PsycopgConnector()) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Define tasks using coroutine functions | ||||||||||||||||||||||||
| @app.task(queue="sums") | ||||||||||||||||||||||||
| async def sum(a, b): | ||||||||||||||||||||||||
| await asyncio.sleep(a + b) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| async with app.open_async(): | ||||||||||||||||||||||||
| # Launch a job | ||||||||||||||||||||||||
| await sum.defer_async(a=3, b=5) | ||||||||||||||||||||||||
|
|
@@ -106,7 +115,11 @@ If you encounter a bug, or want to get in touch, you're always welcome to open a | |||||||||||||||||||||||
| [ticket]. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| [docs]: https://procrastinate.readthedocs.io/ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| [procrastinate]: https://en.wikipedia.org/wiki/Procrastination | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| [django]: https://procrastinate.readthedocs.io/en/stable/howto/django/configuration.html | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| [quickstart]: https://procrastinate.readthedocs.io/en/stable/quickstart.html | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| [ticket]: https://github.com/procrastinate-org/procrastinate/issues/new | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from django.db import migrations | ||
|
|
||
| from .. import migrations_utils | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| operations = [ | ||
| migrations_utils.RunProcrastinateSQL( | ||
| name="03.08.00_01_pre_result_to_job_procedure.sql" | ||
| ), | ||
| ] | ||
| name = "0042_pre_result_column" | ||
| dependencies = [ | ||
| ("procrastinate", "0041_post_retry_failed_job"), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE procrastinate_jobs ADD COLUMN result TEXT; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammatical issue: "it's" should be "its".
"it's" is a contraction of "it is", while "its" is the possessive form needed here.
📝 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents