Как изменить время ожидания в файле "zappa_settings.json" - PullRequest
0 голосов
/ 31 мая 2019

Итак, я развернул свой проект django на аккаунте AWS через Zappa. Затем я добавил параметр timeout_seconds и установил его в 300 в zappa_settings.json. При запуске zappa update dev выдает следующую ошибку:

"botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Timeout, value: Â 300,, type: <class 'str'>, valid types: <class 'int'>"

Я хочу увеличить время ожидания лямбда-функции до 300 секунд.

Вот полная трассировка ошибок:

(venv) C:\Users\tansingh\Downloads\PriceAPP\Code & Sample Input\Aws_pricing>zappa update dev
(s3transfer 0.2.0 (c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages), Requirement.parse('s3transfer<0.2.0,>=0.1.10'), {'boto3'})
Calling update for stage dev..
Downloading and installing dependencies..
 - pandas==0.23.3: Using locally cached manylinux wheel
 - numpy==1.14.5: Using locally cached manylinux wheel
 - sqlite==python3: Using precompiled lambda package
'python3.7'
Packaging project as zip.
Uploading aws-pricing-app-dev-1559297372.zip (36.9MiB)..
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 38.7M/38.7M [00:07<00:00, 3.52MB/s]
Updating Lambda function code..
Updating Lambda function configuration..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 2779, in handle
    sys.exit(cli.handle())
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 509, in handle
    self.dispatch_command(self.command, stage)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 556, in dispatch_command
    self.update(self.vargs['zip'], self.vargs['no_upload'])
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 970, in update
    aws_kms_key_arn=self.aws_kms_key_arn
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\core.py", line 1223, in update_lambda_configuration
    'Mode': 'Active' if self.xray_tracing else 'PassThrough'
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Timeout, value: Â 300,, type: <class 'str'>, valid types: <class 'int'>

==============

Это файл zappa_settings.json:

{
    "dev": {
        "aws_region": "us-east-1",
        "django_settings": "uploads.settings",
        "profile_name": "default",
        "project_name": "aws-pricing-app",
        "runtime": "python3.7",
        "s3_bucket": "od-aws-pricing",
        "timeout_seconds": 300,
        "manage_roles": true,
        "cors": true
    }
}

Может кто-нибудь помочь с этим? Спасибо.

...