heroku H10 desc =“ App崩溃”方法=获取路径=“ /”主机= MyApp

时间:2019-05-17 05:42:23

标签: heroku

结果是关注此:: public abstract class WordAdapter extends RecyclerView.Adapter { private List<Item> itemsList = new ArrayList<>(); //other override methods @Override public long getItemId(int position) { return position; // here each value must be unique either position or data unique id } }

我已经结帐了

code = H10 desc ="App crashed" method=GET ... heroku run rake db:migrate heroku restart-> heroku ps:scale web=1

这只是暂时的。 Bot很快又被淘汰了。

Index.js

heroku ps:scale web=0

Procfile

const { RTMClient } = require('@slack/client');
const token = process.env.SLACK_TOKEN || 'xoxb-....';
const rtm = new RTMClient(token);
const fs = require('fs');
const csv = require('csv-parser');
rtm.start();

 let dataStorage = [];
 new Promise(function(resolve, reject){
    fs.createReadStream('isFirstFile.csv')
        .pipe(csv())
        .on('data', function(data){
            try {
                dataStorage.push(data);
            }
            catch(err) {
                //error handler
            }
        })
        .on('end',function() {

            //some final operation

            resolve(dataStorage);
        })
 }).then(function(values){
     values = JSON.stringify(values);
     rtm.on('message',(message)=>{
         let text = message.text;
         if(text.includes("Twitter")){
             rtm.sendMessage(values, message.channel);
         }
         else if(text.includes("SOOHO")){
             rtm.sendMessage("SOOHO", message.channel);
         }
     });

 })

isFirstFile.csv

worker:node index.js

我使用heroku服务器的免费版本。 我希望它总是打开。

0 个答案:

没有答案