1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SlackのSlashCommandをAWS LambdaのPythonで実装したときにタイムアウトで困っている場合

Last updated at Posted at 2020-04-16

こんな風にすればレスポンスを即時で返して2度めの呼び出しで後続処理をできるのでタイムアウトが出づらくなる。
呼び出し回数は倍になるけど。

def lambda_handler(event, context):

    if "hoge" not in event:
        event["hoge"] = "fuga"
        boto3.client("lambda").invoke(
            FunctionName=context.function_name,
            InvocationType="Event",
            Payload=json.dumps(event),
        )

        return {}

    # 以下本当にやりたい処理

Pythonのは探しても見つからなかったので書いとく

LambdaからLambda呼ぶアクセス権限は別途設定する必要がある

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?