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

Get job id from inside running job #369

Open
mwisnicki opened this issue Dec 13, 2024 · 1 comment
Open

Get job id from inside running job #369

mwisnicki opened this issue Dec 13, 2024 · 1 comment

Comments

@mwisnicki
Copy link

I couldn't find any way to access id of currently running job from inside the function, which would be useful for logging purposes

@meenakumar36
Copy link

Hi, If you need the job id only for logging purpose, as you may know already, the job id is already logged in the application log of postgresql.

As an example:
2025-02-04 17:27:01 IST [1114030]: [32-1] db=,user= LOG: cron job 12 starting: call donightlyjobm();
2025-02-04 17:27:02 IST [1114030]: [33-1] db=,user= LOG: cron job 12 COMMAND completed: CALL

I don't find any other reason for using the job id from within the job. As far as I see, there is no direct way to get this id for now. Let me know if there is any other use of this job id from within the job. Will check on this further. Thanks.

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