【问题标题】:Attribute not found for closure未找到关闭的属性
【发布时间】:2019-02-08 07:47:37
【问题描述】:

代码

    def zappa_async(func):
        print('here')
        @wraps(func)
        @task(capture_response=True)
        def func_wrap_async(*args, **kwargs):
            return func(*args, **kwargs)

        def func_wrap_async_response_id(*args, **kwargs):
            return func_wrap_async(*args, **kwargs).response_id

        return func_wrap_async_response_id

预期行为

获取一个函数并返回一个异步的新函数并返回其响应id

实际行为

lambda throws module 'rap_stats.MapReduce' has no attribute 'func_wrap_async': AttributeError

更新

当我删除“@task”和“.response_id”时它可以工作,但我需要这些才能使其异步正常运行

【问题讨论】:

    标签: python amazon-web-services flask boto3 zappa


    【解决方案1】:

    README 说:

    要捕获响应,您必须在zappa_settings 中配置async_response_table

    这需要完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-15
      • 2019-10-11
      • 2021-03-23
      • 2019-01-26
      • 2013-10-13
      • 2017-08-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多