我正在尝试使用Vapor 3,XCode 9.4.1,Swift 4.1创建一个webAPI和一个Worker进程(在Heroku上)但是无法使解决方案工作在SO“Vapor Xcode项目中的多个目标”中描述。 webAPI工作正常,但我如何创建工作者?
谢谢你的建议,
坦率
您应该只能添加一个worker和一个Web进程。
web: Run serve --env production --hostname 0.0.0.0 --port $PORT
worker: NameOfYourWorkerHere
我很确定heroku让你以这种方式启动多个进程,如果没有,你可能需要启动两个实例,一个用于工作,一个用于Web。