mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge branch 'master' into dashboard_river
* master: Attempting to add logging to socket.io. Reloading feeds when adding a subscription.
This commit is contained in:
commit
d4daf1ac5a
3 changed files with 11 additions and 2 deletions
|
@ -384,6 +384,10 @@ class UserSubscription(models.Model):
|
|||
|
||||
feed.setup_feed_for_premium_subscribers()
|
||||
feed.count_subscribers()
|
||||
|
||||
r = redis.Redis(connection_pool=settings.REDIS_PUBSUB_POOL)
|
||||
r.publish(user.username, 'reload:feeds')
|
||||
|
||||
|
||||
return code, message, us
|
||||
|
||||
|
|
|
@ -53,8 +53,11 @@ io.on 'connection', (socket) ->
|
|||
socket.subscribe = redis.createClient 6379, REDIS_SERVER
|
||||
socket.subscribe.on "error", (err) ->
|
||||
console.log " ---> Error: #{err}"
|
||||
socket.subscribe.quit()
|
||||
socket.subscribe?.quit()
|
||||
socket.subscribe.on "connect", =>
|
||||
log.info @username, "Connected (#{@feeds.length} feeds, #{ip})," +
|
||||
" (#{io.engine.clientsCount} connected) " +
|
||||
" #{if SECURE then "(SSL)" else "(non-SSL)"}"
|
||||
socket.subscribe.subscribe @feeds
|
||||
socket.subscribe.subscribe @username
|
||||
|
||||
|
|
|
@ -55,11 +55,13 @@
|
|||
}
|
||||
socket.subscribe = redis.createClient(6379, REDIS_SERVER);
|
||||
socket.subscribe.on("error", function(err) {
|
||||
var _ref1;
|
||||
console.log(" ---> Error: " + err);
|
||||
return socket.subscribe.quit();
|
||||
return (_ref1 = socket.subscribe) != null ? _ref1.quit() : void 0;
|
||||
});
|
||||
socket.subscribe.on("connect", (function(_this) {
|
||||
return function() {
|
||||
log.info(_this.username, ("Connected (" + _this.feeds.length + " feeds, " + ip + "),") + (" (" + io.engine.clientsCount + " connected) ") + (" " + (SECURE ? "(SSL)" : "(non-SSL)")));
|
||||
socket.subscribe.subscribe(_this.feeds);
|
||||
return socket.subscribe.subscribe(_this.username);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue