[PR #18899] [MERGED] Fixes #18880: Delay enqueuing of background tasks until the DB transaction has been committed #15466

Closed
opened 2025-12-30 00:22:06 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18899
Author: @jeremystretch
Created: 3/13/2025
Status: Merged
Merged: 3/13/2025
Merged by: @jnovinger

Base: mainHead: 18880-delay-rq-tasks


📝 Commits (1)

  • f448248 Fixes #18880: Delay enqueuing of background tasks until the DB transaction has been committed

📊 Changes

1 file changed (+6 additions, -3 deletions)

View changed files

📝 netbox/core/models/jobs.py (+6 -3)

📄 Description

Fixes: #18880

Rather than calling enqueue or enqueue_at directly, we now create a callback function to be invoked only after the current database transaction (if any) has been committed successfully.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/18899 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/13/2025 **Status:** ✅ Merged **Merged:** 3/13/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `18880-delay-rq-tasks` --- ### 📝 Commits (1) - [`f448248`](https://github.com/netbox-community/netbox/commit/f4482486d4db20e1d2546dd8e6fb9a6ce17e30c9) Fixes #18880: Delay enqueuing of background tasks until the DB transaction has been committed ### 📊 Changes **1 file changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/models/jobs.py` (+6 -3) </details> ### 📄 Description ### Fixes: #18880 Rather than calling `enqueue` or `enqueue_at` directly, we now create a callback function to be invoked only after the current database transaction (if any) has been committed successfully. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:22:06 +01:00
adam closed this issue 2025-12-30 00:22:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15466