03/01/2023, 8:59 PM
hey guys, I'm really struggling here to run async flows on a deployment through the UI. This works completely fine locally however, so it is quite frustrating
ex: .run() is an async def function of the class PositionManager()
@flow(name = "Put Spread Algorithm ASYNC", task_runner=ConcurrentTaskRunner())
async def AsyncFlowOptionSpreadTrading(*args, **kwargs):
    logger = get_run_logger()
    context = get_run_context()

    # load config block
    config = await JSON.load('put-spread-default-config')
    position_manager_instance = PositionManager(api_url, api_token, account_id, dfTrade, dfminimum_credit, **config)    
the error I'm getting is "this event loop is already running" but this error only occurs when trying to run a deployment on the UI (which is deployed to an aws ecs task)

Taylor Curran

03/01/2023, 10:56 PM
There can be many different errors when running a flow in a service like ECS, many revolve around permissioning and networking. Are you sure the agent has the necessary permissions?