When does the Meteor server restart?

meteor

Solution

Yes, it's the correct behavior. Take a look at lines 35 and 36 of leaderboard.js. On server startup (line 35), if there are no scientists in the database (line 36), then it inserts the six people in the file. Terminating meteor doesn't clear the database, but 'meteor reset' does, and that's why you see what you see.

Basically, those six people are supposed to be the initial contents of the leaderboard when the app is first deployed -- they're not supposed to be re-added every time the server is restarted.

Problem

I run the Leaderboard example. Then I changed one of the scientist entries in the names variable (part of the Meteor.startup function argument initialization) in leaderboard.js and saved the file. Should I expect meteor to push the updated list in the browser? It didn't in my case. So I terminated meteor (Contrl-C in the console). And run it again, yet again the old list still appeared, not the new one. Finally, only after running meteor reset in the command line and running meteor again the changed list appeared in the browser (localhost). Is this the expected behavior? Thanks.

Original source