2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

Fix task group (#9777)

* Fix group for offload_task

* Add group labels
This commit is contained in:
Oliver
2025-06-14 12:15:02 +10:00
committed by GitHub
parent c027a7cf7d
commit ba4a23757e
4 changed files with 4 additions and 3 deletions

View File

@ -177,7 +177,7 @@ class InvenTreeConfig(AppConfig):
try:
if django_q.models.OrmQ.objects.count() == 0:
InvenTree.tasks.offload_task(
InvenTree.tasks.heartbeat, force_async=True
InvenTree.tasks.heartbeat, force_async=True, group='heartbeat'
)
except Exception:
pass

View File

@ -460,6 +460,7 @@ class DataExportViewMixin:
export_format,
export_context,
output.id,
group='exporter',
)
output.refresh_from_db()

View File

@ -265,7 +265,7 @@ class DataImportSession(models.Model):
self.status = DataImportStatusCode.IMPORTING.value
self.save()
offload_task(importer.tasks.import_data, self.pk)
offload_task(importer.tasks.import_data, self.pk, group='importer')
def import_data(self) -> None:
"""Perform the data import process for this session."""

View File

@ -1801,7 +1801,7 @@ class StockItem(
# Rebuild the stock tree
InvenTree.tasks.offload_task(
stock.tasks.rebuild_stock_item_tree, tree_id=self.tree_id, group='part'
stock.tasks.rebuild_stock_item_tree, tree_id=self.tree_id, group='stock'
)
@transaction.atomic