You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In agave/tasks/sqs_tasks.py, the run_task function currently extracts request and response models on each execution using get_request_model(task_func) and get_response_model(task_func). Since the task function doesn't change between executions, this is unnecessary and inefficient.
Proposed Solution
Move the model extraction out of the run_task function so it happens only once when the task is defined or initialized, and then reuse these models for each task execution.
For example, this could be done in the task decorator or when creating a new task instance:
Problem
In
agave/tasks/sqs_tasks.py
, therun_task
function currently extracts request and response models on each execution usingget_request_model(task_func)
andget_response_model(task_func)
. Since the task function doesn't change between executions, this is unnecessary and inefficient.Proposed Solution
Move the model extraction out of the
run_task
function so it happens only once when the task is defined or initialized, and then reuse these models for each task execution.For example, this could be done in the task decorator or when creating a new task instance:
This optimization would improve performance for frequently executed tasks.
Related PR: #159 (comment)
The text was updated successfully, but these errors were encountered: