mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-30 21:25:36 +00:00
Fix for offloading of check_for_migrations (#12041)
* Do not raise exception in offload_task
* Revert "Do not raise exception in offload_task"
This reverts commit 9f9a9a5240.
* Improve offloading of check_for_migrations
* update playwright
Ref: https://github.com/microsoft/playwright/issues/40998
This commit is contained in:
@@ -64,9 +64,20 @@ class InvenTreeConfig(AppConfig):
|
|||||||
self.collect_tasks()
|
self.collect_tasks()
|
||||||
self.start_background_tasks()
|
self.start_background_tasks()
|
||||||
|
|
||||||
if not InvenTree.ready.isInTestMode(): # pragma: no cover
|
if (
|
||||||
|
not InvenTree.ready.isInTestMode()
|
||||||
|
and not InvenTree.ready.isInWorkerThread()
|
||||||
|
): # pragma: no cover
|
||||||
# Let the background worker check for migrations
|
# Let the background worker check for migrations
|
||||||
InvenTree.tasks.offload_task(InvenTree.tasks.check_for_migrations)
|
# Don't offload task if we are already *in* the background worker, otherwise we might end up in a deadlock situation
|
||||||
|
|
||||||
|
try:
|
||||||
|
InvenTree.tasks.offload_task(InvenTree.tasks.check_for_migrations)
|
||||||
|
except Exception as exc:
|
||||||
|
logger.exception(
|
||||||
|
'Failed to offload check_for_migrations task: %s', exc
|
||||||
|
)
|
||||||
|
|
||||||
# Update exchange rates
|
# Update exchange rates
|
||||||
InvenTree.tasks.offload_task(
|
InvenTree.tasks.offload_task(
|
||||||
InvenTree.tasks.update_exchange_rates, force_async=True
|
InvenTree.tasks.update_exchange_rates, force_async=True
|
||||||
|
|||||||
Reference in New Issue
Block a user