代码之家  ›  专栏  ›  技术社区  ›  lazarus

aws lambda公司上下文。成功(在节点中)python中的备选方案

  •  2
  • lazarus  · 技术社区  · 6 年前

    requests.post('url', json_data) 到我的应用程序端点,这一切都很好。

    唯一的问题是lambda函数被多次调用,

    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'aws_request_id', 'client_context', 'function_name', 'function_version', 'get_remaining_time_in_millis', 'identity', 'invoked_function_arn', 'log', 'log_group_name', 'log_stream_name', 'memory_limit_in_mb']
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   romeo14    5 年前

    在我的例子中,仅仅从处理程序返回一个真值就停止了在S3事件期间多次调用该处理程序。

    def index(event, context):
        # actions here
    
        return True