Skip to content
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

Adding name of the job producer #66

Open
riyadparvez opened this issue Mar 25, 2021 · 2 comments
Open

Adding name of the job producer #66

riyadparvez opened this issue Mar 25, 2021 · 2 comments

Comments

@riyadparvez
Copy link

Is it possible to add the name of the job producer? It would be very helpful.

from psycopg2 import connect
from pq import PQ

conn = connect('dbname=example user=postgres')
pq = PQ(conn, client_name='test_client')

Worker will see the name of producer. And preferrably adding column submitted_by into the database schema.

>>> job
<pq.Job id=77709 submitted_by="test_client" size=1 enqueued_at="2014-02-21T16:22:06Z" schedule_at=None>
@stas
Copy link
Collaborator

stas commented Mar 26, 2021

Hmm, might make more sense to leverage the application_name in the connection string, this way the API doesn't change... 🤔
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

@riyadparvez
Copy link
Author

That's better option actually. It'd be helpful if you can add a property submitted_by or something similar to the Job class: https://github.com/malthe/pq/blob/master/pq/__init__.py#L395

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

No branches or pull requests

2 participants