In case mongodb isn't connected on favicon server.

This commit is contained in:
Samuel Clay 2016-11-30 13:44:50 -08:00
parent 7fcc8a4c71
commit 7dcb16605e
3 changed files with 4 additions and 3 deletions

2
fabfile.py vendored
View file

@ -1459,7 +1459,9 @@ def kill():
else:
run('./utils/kill_gunicorn.sh')
@parallel
def deploy_node():
pull()
with virtualenv():
run('sudo supervisorctl restart node_unread')
run('sudo supervisorctl restart node_unread_ssl')

View file

@ -21,7 +21,7 @@ else
url = "mongodb://#{MONGODB_SERVER}:#{MONGODB_PORT}/newsblur?replicaSet=nbset&readPreference=secondaryPreferred"
mongo.MongoClient.connect url, (err, db) =>
console.log " ---> Connected to #{db.serverConfig?.s.host}:#{db.serverConfig?.s.port} / #{err}"
console.log " ---> Connected to #{db?.serverConfig.s.host}:#{db?.serverConfig.s.port} / #{err}"
@collection = db.collection "feed_icons"
app.get /\/rss_feeds\/icon\/(\d+)\/?/, (req, res) =>

View file

@ -33,8 +33,7 @@
mongo.MongoClient.connect(url, (function(_this) {
return function(err, db) {
var _ref, _ref1;
console.log(" ---> Connected to " + ((_ref = db.serverConfig) != null ? _ref.s.host : void 0) + ":" + ((_ref1 = db.serverConfig) != null ? _ref1.s.port : void 0) + " / " + err);
console.log(" ---> Connected to " + (db != null ? db.serverConfig.s.host : void 0) + ":" + (db != null ? db.serverConfig.s.port : void 0) + " / " + err);
return _this.collection = db.collection("feed_icons");
};
})(this));