我剛剛設定了 Heroku,這很容易,但是當我測驗它時,什么也沒發生。即使機器人在線,所以我查看了 Heroku 中的日志,一切看起來都很好。mongodb 已連接,它說我的機器人在線。我嘗試使用新的不和諧令牌重新啟動測功機,完全重新啟動我的應用程式,但沒有任何效果。非常感謝幫助!(我正在使用 GitHub 進行部署)
這是我的 Heroku 日志: https ://i.stack.imgur.com/lEciI.png
以防萬一我的Procfile:
worker: node main.js
uj5u.com熱心網友回復:
你試過使用workflows嗎?它們非常易于使用,只需要您 2 分鐘的時間,因為 Heroku 在自動部署分支時可能會出現問題。
Instructions
- 創建
.github檔案夾 - 在該檔案夾中創建一個
workflows檔案夾 - 在該檔案夾中創建一個
main.yml檔案 - 插入以下代碼:
name: Deploy
on:
push:
branches:
- main # the branch to deploy to heroku
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}} #go to settings and under copy your token key, then go to your repository add a secret in the settings of the repository with name `HEROKU_API_KEY` and value `your API key`
heroku_app_name: "herokuappname" #Must be exact with yours
heroku_email: "youremail"
所以你的路徑應該是.github/workflows/main.yml
如果您需要進一步的幫助,那么您可以在此處發表評論,如果工人已啟用,請確保在資源中查看 ??。我希望我有幫助??
uj5u.com熱心網友回復:
嘗試添加
client.on('debug', console.log);
在你的 main.js 中的某個地方。
您很可能遇到 429 錯誤,因為 Heroku 使用公共帳戶的共享 IP 地址。
如果您在添加除錯行后運行機器人并獲得 429 錯誤型別
kill 1
在您的機器人的終端中。這將迫使您的機器人重新啟動,并希望當您重新運行它時它會再次作業。
uj5u.com熱心網友回復:
如果這是您第一次使用heroku,請嘗試查看您的package.json然后找到engines.
"engines": {
"node": "16.x"
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/487636.html
下一篇:Tensorflow:`tf.reshape((),(0))`在Eager模式下作業正常,但在Graph模式下ValueError
