【发布时间】:2014-04-29 17:15:14
【问题描述】:
我已将一个应用程序部署到 Heroku,但我不断收到从 Logentries 发送给我的 R12 错误。我已经研究了解决这个问题的各种方法 - 但仍然没有乐趣:(
这是我的引导程序:
var apiService = loader.load('apiService'),
http = require('http'),
server,
app;
apiService.init(); // see later
app.configure(function() {
RedisStore = loader.load('connect-redis')(express);
redis_store = new RedisStore(config.redis);
/* view and routes config...*/
});
server = http.createServer(app);
server.listen(process.env.PORT || 3000);
process.on('SIGTERM', function () {
server.close();
apiService.close();
redis_store = null; // worth a punt?
});
api服务:
api.init = function () {
mongoose.connect(mongourl);
};
api.close = function () {
mongoose.connection.close();
};
其他人有这个问题/有什么想法吗?
【问题讨论】: