我有一個功能,我想每 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
uj5u.com熱心網友回復:
functions.pubsub.schedule()
使用 Cloud Scheduler 來安排運行函式。最小時間粒度為 1 分鐘。
下圖顯示了將從“每 8 秒”轉換為 Cron 作業格式的欄位。請注意,沒有第二個欄位,因此您的請求無效。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/496525.html