firebase函数部署有错误

发布于 2025-02-11 00:31:11 字数 1634 浏览 0 评论 0原文

我有一个我想每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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兔姬 2025-02-18 00:31:11

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

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文