lib/models/tokens.js
function harvest() {
  var q = "DELETE FROM tokens WHERE expires_at < now() AT TIME ZONE 'UTC'";
  db.getClient(function(err, client, done) {
    client.query(q, function(err) {
      if(err) {
        console.error(new Date);
        console.error(err.stack);
      }
      done(err);
    });
  });
}
function harvest() {
  var q = "DELETE FROM tokens WHERE expires_at < now() AT TIME ZONE 'UTC'";
  db.getClient(function(err, client, done) {
    client.query(q, function(err) {
      if(err) {
        console.error(new Date);
        console.error(err.stack);
      }
      done(err);
    });
  });
}
function harvest ( ) { var q = "DELETE FROM tokens WHERE expires_at < now() AT TIME ZONE 'UTC'" ; db . getClient ( function ( err , client , done ) { client . query ( q , function ( err ) { if ( err ) { console . error ( new Date ) ; console . error ( err . stack ) ; } done ( err ) ; } ) ; } ) ; }
Deletes expired tokens
Deletes expired tokens