procrastinate-org / procrastinate

PostgreSQL-based Task Queue for Python
https://procrastinate.readthedocs.io/
MIT License
800 stars 52 forks source link

Call configure callback in listen notify #1078

Closed aleksandr-shtaub closed 3 weeks ago

aleksandr-shtaub commented 3 weeks ago

Closes #1074

Now when you provide configure callable to PsycopgConnector it will also be applied in PsycopgConnector.listen_notify().

Consequently, now you have a way to disable prepared statements on psycopg<3.1:


def configure(connection):
    # disable prepared statements for connection
    connection.prepare_threshold = None

PsycopgConnector(configure=configure)

Successful PR Checklist:

PR label(s):

ewjoachim commented 3 weeks ago

I'm very hyped that you took the matter into your own hands :) Thank you very much ! If there's anything I can help with, please let me know !

github-actions[bot] commented 3 weeks ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  psycopg_connector.py
  tasks.py
Project Total  

This report was generated by python-coverage-comment-action

aleksandr-shtaub commented 3 weeks ago

I'm very hyped that you took the matter into your own hands :) Thank you very much ! If there's anything I can help with, please let me know !

No problem 😉

ewjoachim commented 3 weeks ago

Awesome, thank you !