Skip to content

feat: integrate django-tasks-db - #1583

Open
tcely wants to merge 9 commits into
mainfrom
tcely-django-tasks
Open

feat: integrate django-tasks-db#1583
tcely wants to merge 9 commits into
mainfrom
tcely-django-tasks

Conversation

@tcely

@tcely tcely commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

TODO

  • Services for the consumer workers
  • Enqueue startup tasks in ready

Repository

https://github.com/RealOrangeOne/django-tasks-db

Queues

  1. database
  2. filesystem
  3. network
  4. limited
  5. default

A worker service for limited. Multiple worker services for the remaining queues.

Services

Bundle: django-tasks-consumers

  1. django-tasks-default
  2. django-tasks-net-limited

Flags: -v 2 --no-reload --interval 20 --max-tasks 100 --queue-name '*' --exclude-queues limited

Worker

usage output
usage: manage.py db_worker [-h] [--queue-name [QUEUE_NAME]]
                           [--exclude-queues [EXCLUDE_QUEUES]]
                           [--interval [INTERVAL]] [--batch]
                           [--reload | --no-reload]
                           [--backend [BACKEND_NAME]]
                           [--no-startup-delay]
                           [--max-tasks [MAX_TASKS]]
                           [--worker-id [WORKER_ID]] [--version]
                           [-v {0,1,2,3}] [--settings SETTINGS]
                           [--pythonpath PYTHONPATH] [--traceback]
                           [--no-color] [--force-color]
                           [--skip-checks]

Run a database background worker

options:
  -h, --help            show this help message and exit
  --queue-name [QUEUE_NAME]
                        The queues to process. Separate multiple with a comma.
                        To process all queues, use '*' (default: 'default')
  --exclude-queues [EXCLUDE_QUEUES]
                        Queues to exclude. Separate multiple with a comma.
  --interval [INTERVAL]
                        The interval (in seconds) to wait, when
                        there are no tasks in the queue, before
                        checking for tasks again (default: 1)
  --batch               Process all outstanding tasks, then exit.
                        Can be used in combination with --max-                               tasks.
  --reload, --no-reload
                        Reload the worker on code changes.
                        Not recommended for production as tasks may not
                        be stopped cleanly (default: DEBUG)
  --backend [BACKEND_NAME]
                        The backend to operate on (default: 'default')
  --no-startup-delay    Don't add a small delay at startup.
  --max-tasks [MAX_TASKS]
                        If provided, the maximum number of tasks
                        the worker will execute before exiting.
  --worker-id [WORKER_ID]
                        Worker id. MUST be unique across worker
                        pool (default: auto-generate)
  --version             Show program's version number and exit.
  -v, --verbosity {0,1,2,3}
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't
                        provided, the DJANGO_SETTINGS_MODULE
                        environment variable will be used.
  --pythonpath PYTHONPATH
                        A directory to add to the Python path, e.g.
                        "/home/djangoprojects/myproject".
  --traceback           Display a full stack trace on CommandError exceptions.
  --no-color            Don't colorize the command output.
  --force-color         Force colorization of the command output.
  --skip-checks         Skip system checks.

@tcely tcely self-assigned this Sep 3, 2026
@tcely tcely moved this to Todo in Status Sep 3, 2026
Added django_tasks_db to installed apps and configured TASKS settings.
Updated db_vendor reference to use db.connection.vendor in the one place it was used.
Introduce threading for cleanup tasks and utilize `ThreadPoolExecutor` for concurrent execution.
@tcely
tcely marked this pull request as ready for review September 3, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant