【发布时间】:2019-12-20 04:31:54
【问题描述】:
我正在使用 Bref(使用无服务器)在 AWS Lambda 上运行 Symfony 4 (PHP) 应用程序。
Bref 为 Symfony 的 bin/console 二进制文件提供了一层。 Lambda 函数的无服务器配置如下所示:
functions:
console:
handler: bin/console
name: 'mm-console'
description: 'Symfony 4 console'
timeout: 120 # in seconds
layers:
- ${bref:layer.php-73} # PHP
- ${bref:layer.console} # The "console" layer
使用上面的方法,我可以在 Lambda 上运行 vendor/bin/bref cli mm-console -- mm:find-matches 来运行 bin/console mm:find-matches。
如果我想在 Lambda 上按计划运行mm:find-matches 控制台命令怎么办?
我试过这个:
functions:
mm-find-matches:
handler: "bin/console mm:find-matches"
name: 'mm-find-matches'
description: 'Find mentor matches'
timeout: 120
layers:
- ${bref:layer.php-73} # PHP
- ${bref:layer.console} # The "console" layer
schedule:
rate: rate(2 hours)
但是“bin/console mm:find-matches”不是有效的处理程序。
如何按计划将mm:find-matches 命令传递给bin/console 函数?
【问题讨论】:
标签: aws-lambda serverless-framework serverless aws-serverless bref