通过反复试验,我找到了以下解决方案:
-
在中创建任务
tasks.json
文件
-
在现有数据库中添加“启动前任务”
launch.json
引用任务的配置
注意:我还更新了版本。
任务。json
{
"version": "2.0.0",
"tasks": [
{
"label": "Redis Queue",
"command": "./dequeue.sh",
"type": "shell",
"options": {"cwd": "${workspaceFolder}"}
}
]
}
发射json
{
"version": "0.2.0",
"configurations": [
{
"name": "API",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/app/run.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/app",
"preLaunchTask": "Redis Queue"
}
]
}