hey guys, I'm really struggling here to run async ...
# ask-community
c
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()
Copy code
@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)    
    await position_manager_instance.run()
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)
t
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?