Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-22 22:37:06 +03:00
parent f8ad642cdc
commit 97eff3a816

View File

@@ -679,11 +679,9 @@ func productSeriesEnqueueTx(ctx context.Context, tx *sql.Tx, productCode, colorC
_, err := tx.ExecContext(ctx, `
INSERT INTO mk_product_series_recalc_queue (row_key, product_code, color_code, dim3_code, reason, status, attempts, available_at, queued_at, last_error, created_at, updated_at)
VALUES ($1, $2, $3, $4, $5, 'pending', 0, now(), now(), '', now(), now())
ON CONFLICT (row_key) WHERE status IN ('pending','processing') DO NOTHING
`, productSeriesAutoKey(productCode, colorCode, dim3Code), productCode, colorCode, dim3Code, strings.TrimSpace(reason))
if err != nil {
if pe, ok := err.(*pq.Error); ok && pe != nil && string(pe.Code) == "23505" {
return 0, nil
}
return 0, err
}
return 1, nil