真坑,保存半天保存不了;下面直接给你们现成的代码;直接右键上传即可;
阿里云
{
"name": "timer",
"dependencies": [],
"extensions": {},
"main": "index.js",
"cloudfunction-config": {
"memorySize": 512,
"timeout": 60,
"triggers": [
{
"name": "myTrigger",
"type": "timer",
"config": "0 * * * * * *"
}
],
"path": "",
"runtime": "Nodejs16",
"concurrency": 1
}
}
腾讯云
{
"name": "timedTasks",
"dependencies": [],
"extensions": {
"uni-cloud-jql": []
},
"cloudfunction-config": {
"memorySize": 256,
"timeout": 33,
"triggers": [
{
"name": "myTrigger",
"type": "timer",
"config": "*/5 * * * * * *"
}
],
"path": "",
"runtime": "Nodejs8"
}
}

本文提供了阿里云和腾讯云中设置定时任务(云函数)的代码片段,包括了各自云函数的配置,如内存大小、超时时间和触发器设置。
9721

被折叠的 条评论
为什么被折叠?



