Skip to content

Commit

Permalink
Fix tasks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Nov 6, 2023
1 parent 46b3784 commit c77b398
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions InvenTree/InvenTree/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def offload_task(taskname, *args, force_async=False, force_sync=False, **kwargs)
from InvenTree.status import is_worker_running
except AppRegistryNotReady: # pragma: no cover
logger.warning("Could not offload task '%s' - app registry not ready", taskname)

if force_async:
# Cannot async the task, so return False
return False
Expand Down Expand Up @@ -242,12 +242,11 @@ def offload_task(taskname, *args, force_async=False, force_sync=False, **kwargs)
except Exception as exc:
raise_warning(f"WARNING: '{taskname}' not started due to {str(exc)}")
return False

# Finally, task either completed successfully or was offloaded
return True



@dataclass()
class ScheduledTask:
"""A scheduled task.
Expand Down

0 comments on commit c77b398

Please sign in to comment.