Add application name to transaction

Trying to find what's getting locked
This commit is contained in:
Eli Ribble 2026-04-17 21:27:30 +00:00
parent 3196b73a80
commit a6ca30fdb1
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View file

@ -15,6 +15,7 @@ import (
"github.com/Gleipnir-Technology/nidus-sync/platform/types"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/rs/zerolog/log"
)
func ComplianceRequestMailerCreate(ctx context.Context, user User, site_id int32) (int32, error) {

View file

@ -93,6 +93,8 @@ func addWaitingJobs(ctx context.Context) error {
continue
}
defer txn.Rollback(ctx)
app_name := fmt.Sprintf("restarted job %d", job.ID)
txn.Exec(fmt.Sprintf("SET application_name = '%s'", app_name))
err = handleJob(ctx, txn, job)
if err != nil {
sublog.Error().Err(err).Msg("failed handle job")