Created
May 13, 2014 21:19
-
-
Save henryboldi/73eeebd7e76b540f2a31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bootstrap | |
* | |
* An asynchronous boostrap function that runs before your Sails app gets lifted. | |
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic. | |
* | |
* For more information on bootstrapping your app, check out: | |
* http://sailsjs.org/#documentation | |
*/ | |
module.exports.bootstrap = function(cb) { | |
// It's very important to trigger this callack method when you are finished | |
// with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap) | |
User.update({}, { | |
online: false | |
}, | |
function userUpdated(err, users) { | |
if (err) { | |
console.log(err); | |
} else { | |
// console.log(users); | |
} | |
cb(); | |
} | |
) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment