firebase函数部署有错误
我有一个我想每8秒运行一次的函数。但是我在安装它时会遇到错误。当我将几秒钟更改为“每8小时”时,它会加载。它没有任何错误。 firebase pubsub是否在几秒钟内不接受时间?
const otherMatchBotModule = require("./otherMatchBotActive");
exports.otherMatchBotActive = functions.pubsub.schedule("every 8 seconds").onRun(otherMatchBotModule.otherMatchBot);
控制台输出:
i functions: creating Node.js 14 function otherMatchBotActive(us-central1)...
Functions deploy had errors with the following functions:
otherMatchBotActive(us-central1)
i functions: cleaning up build files...
Error: There was an error deploying functions
日志文件详细信息:
[debug] [2022-06-28T01:36:49.114Z] Error: Failed to upsert schedule function otherMatchBotActive in region us-central1
at /Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:38:11
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Fabricator.upsertScheduleV1 (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:378:9)
at async Fabricator.setTrigger (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:347:17)
at async Fabricator.createEndpoint (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:124:9)
at async handle (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:75:17)
[error]
[error] Error: There was an error deploying functions
I have a function that I want to run every 8 seconds. but i am getting error while installing it. It loads when I change the seconds to "every 8 hours". it doesn't give any errors. Does firebase pubsub not accept times in seconds?
const otherMatchBotModule = require("./otherMatchBotActive");
exports.otherMatchBotActive = functions.pubsub.schedule("every 8 seconds").onRun(otherMatchBotModule.otherMatchBot);
console output:
i functions: creating Node.js 14 function otherMatchBotActive(us-central1)...
Functions deploy had errors with the following functions:
otherMatchBotActive(us-central1)
i functions: cleaning up build files...
Error: There was an error deploying functions
log file details:
[debug] [2022-06-28T01:36:49.114Z] Error: Failed to upsert schedule function otherMatchBotActive in region us-central1
at /Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:38:11
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Fabricator.upsertScheduleV1 (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:378:9)
at async Fabricator.setTrigger (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:347:17)
at async Fabricator.createEndpoint (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:124:9)
at async handle (/Users/durak/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:75:17)
[error]
[error] Error: There was an error deploying functions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
functions.pubsub.schedule()
使用云调度程序安排运行功能。最小的时间粒度为1分钟。下图显示了将从“每8秒”转换为cron作业格式的字段。请注意,没有第二个字段,因此您的请求无效。
cron作业格式
cron noreferrer“> //i.sstatic.net/ruxnf.png“ rel =“ nofollow noreferrer”>
functions.pubsub.schedule()
uses Cloud Scheduler to schedule running a function. The smallest time granularity is 1 minute.The following image shows the fields that will be translated from "every 8 seconds" to the Cron job format. Notice that there is no second field, therefore your request is invalid.
Cron job format