Skip to content

Commit

Permalink
remove a possible memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed Feb 16, 2015
1 parent 41dea06 commit bd077a0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions soundtrack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var heapdump = require('heapdump');

// config, general requirements
var config = require('./config'); config.jobs = { enabled: false };
var database = require('./db');
Expand Down Expand Up @@ -293,11 +293,11 @@ app.post('/skip', requireLogin, function(req, res) {
});

sock.on('connection', function(conn) {

app.clients[ conn.id ] = conn;

var room = conn.headers.host.split('.')[0];
if (!app.rooms[ room ]) return;

app.clients[ conn.id ] = conn;
var connRoom = app.rooms[ room ];

conn.room = connRoom._id.toString();
Expand Down Expand Up @@ -433,10 +433,7 @@ if (config.spotify && config.spotify.id && config.spotify.secret) {
callbackURL: ((config.app.safe) ? 'https://' : 'http://') + config.app.host + '/auth/spotify/callback',
passReqToCallback: true
}, function(req, accessToken, refreshToken, profile, done) {
console.log('spotify profile', profile);
console.log('access token', accessToken);
console.log('refreshToken', refreshToken);


Person.findOne({ $or: [
{ _id: (req.user) ? req.user._id : undefined }
, { 'profiles.spotify.id': profile.id }
Expand Down

0 comments on commit bd077a0

Please sign in to comment.