Skip to content

feat: add progress tracking to PostgreSQL result backend#20

Open
long2ice wants to merge 1 commit into
z22092:mainfrom
long2ice:main
Open

feat: add progress tracking to PostgreSQL result backend#20
long2ice wants to merge 1 commit into
z22092:mainfrom
long2ice:main

Conversation

@long2ice
Copy link
Copy Markdown

@long2ice long2ice commented Feb 6, 2026

  • Introduced a new progress column to the result table to store task progress.
  • Implemented set_progress and get_progress methods for updating and retrieving task progress in the PostgreSQL backend.

Description

Brief description of the changes in this PR.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Maintenance (dependency updates, CI improvements, etc.)

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested with multiple PostgreSQL drivers (if applicable)

Test Configuration

  • Python version(s):
  • PostgreSQL version:
  • Driver(s) tested:
  • Operating System:

Performance Impact

  • No performance impact
  • Positive performance impact
  • Negative performance impact (please describe)

Performance details:

Documentation

  • I have updated the documentation accordingly
  • I have updated the README if needed
  • I have added docstrings to new functions/classes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Related Issues

Closes #(issue number)

Screenshots (if applicable)

Additional Notes

Any additional information that reviewers should know about this PR.

- Introduced a new `progress` column to the result table to store task progress.
- Implemented `set_progress` and `get_progress` methods for updating and retrieving task progress in the PostgreSQL backend.
Copy link
Copy Markdown

@ans-artal ans-artal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@long2ice
I think saving the progress under the same key as the results and making the result column nullable=True will affect the behavior of get_result.

With this change, once progress is set, get_result stops raising ResultIsMissingError and returns None instead.

Also, if someone sets keep_results=False and calls get_result, the progress gets deleted even if the results have not been set yet.

====

Maybe you could handle it like the official Redis backend:
https://github.com/taskiq-python/taskiq-redis/blob/main/taskiq_redis/redis_backend.py

It reuses the result table but appends a PROGRESS_KEY_SUFFIX to the task UUID.

@ans-artal
Copy link
Copy Markdown

ans-artal commented May 11, 2026

Maybe :
#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants