Psycopg2-mq

Latest version: v0.13.5

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 10

0.12

-----------------

- Support a job being linked properly to multiple schedule and listener sources such
that provenance is properly tracked on retries.

- Add a new ``CANCELED`` job state that can be used to manually mark any pending,
failed, or lost jobs as canceled. Jobs do not enter this state automatically - theyt
must be manually marked but will be useful to disambiguate failed from canceled.

- [breaking] ``job.schedule_id`` is removed from the job object passed to background
workers.

- [model migration] Moved the ``schedule_id`` and ``listener_id`` foreign keys from
the ``Job`` table to many-to-many link tables to support tracking the source properly
when collapsing occurs. Possible migration::

insert into mq_job_schedule_link (job_id, schedule_id)
select id, schedule_id from mq_job where schedule_id is not null;

insert into mq_job_listener_link (job_id, listener_id)
select id, listener_id from mq_job where listener_id is not null;

alter table mq_job drop column schedule_id;
alter table mq_job drop column listener_id;

- [model migration] Add a new ``CANCELED`` state to the ``mq_job_state`` enum.
Possible migration::

alter type mq_job_state add value 'canceled';

0.11

-----------------

- Add support for Python 3.13.

- [breaking] Modified the ``MQSource.call``, and ``MQSource.add_schedule`` APIs such
that when a cursor is used ``collapse_on_cursor`` defaults to ``False`` instead of
``True``. You must explicitly set it to ``True`` in scenarios in which that is
desired as it is no longer the default behavior.

- [model migration] Add ``collapse_on_cursor`` attribute to
the ``JobSchedule`` model. A bw-compat migration would set this value to ``False``
if ``cursor_key`` is ``NULL`` and ``True`` on everything else.

- [model migration] Add a new ``JobListener`` model.

- [model migration] Add ``listener_id`` foreign key to the ``Job`` model.

- Fix a bug in which NOTIFY events were missed in some cases causing jobs to wait
until the maintenance window to execute.

- Add the concept of pub/sub event listeners. Listeners can be registered that act as a
job factory, creating a new job when an event is emitted.

It is possible to emit events manually as needed via the ``MQSource.emit_event`` API.

Events are emitted automatically when a job is completed. Every job when it is
completed successfully emits a new ``mq_job_complete:<queue>.<method>`` event.
This event contains the result of the job.

- The ``MQSource`` that is used by the ``MQWorker`` can now be overridden via the
``mq_source_factory`` option.

0.10

------------------

- Add support for Python 3.12.

- Drop support for Python 3.7, and 3.8.

- Fix a race condition on shutdown where the job fails to cleanup because the triggers
are gone while the pool is still shutting down.

0.9

----------------

- Add support for Python 3.10, and 3.11.

- [breaking] Prevent retrying of collapsible jobs. Require them to be invoked
using ``call`` instead for an opportunity to specify a ``conflict_resolver``.

- [model migration] Fix a bug in the default model schema in which the
collapsible database index was not marked unique.

- Copy trace info when retrying a job.

- Capture the stringified exception to the job result in the ``message`` key,
alongside the existing ``tb``, ``exc``, and ``args`` keys.

- The worker was not recognizing ``capture_signals=False``, causing problems
when running the event loop in other threads.

- Blackify the codebase and add some real tests. Yay!

0.8.3

------------------

- [breaking] Remove ``MQWorker.make_job_context``.

0.8.2

------------------

- Drop Python 3.6 support.

- [breaking] Require SQLAlchemy 1.4+ and resolve deprecation warnings related to
SQLAlchemy 2.0.

- [model migration] Rename ``update_job_id`` to ``updated_job_id`` in the
``JobCursor`` model.

Page 4 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.