How can I trigger a reload of the the server manually?

Hello,

i’d like to control the reloads of the server myself. For the client side there are multiple packages, but I couldn’t find a lot to go on for the server.

I found a parameter “–once” which prevents meteor from auto-reloading anything when passed to the meteor command line tool.

That’s great, and now I’d like to “manually” trigger a reload. How could I possibly do that? I checked the source if some packages I thought might be relevant (meteors’ reload, appcache, autoload packages), but I couldn’t figure it out.

It could be something I’d enter into the Meteor Shell for example?

Thanks for your input!

This is a development switch to the meteor command - it’s not something available in production (where there is no meteor). I just wanted to check that this behaviour is something you want in development only?

Have you looked into the meteor shell? I haven’t used it for this specific purpose but I understand it can be used to do a meteor server restart.

Hi, yes, I’d like to do this in development, not in production. It’s about development speed, especially when developing server side processes. I’d like to be able to control the moment of restarting myself.

Meteor Shell is nice, but I still don’t know what options I have there for my particular use case.

As @elewis33 says, you can use the .reload command within meteor shell to do this.

Edit: no you can’t … while it will reload if run “normally”, it won’t if you used --once.

Dammit! :slight_smile: Thanks for having a look!

1 Like

The “hard” way, as long as you run using the meteor command I guess, might be useful for testing / developing:

/**
 * Restart the server. This is most useful for the time-based simulation as that tends to go haywire after some repeated runs...
 */

if (Meteor.isAppTest) {
    Meteor.methods({
        'TC.tests.server.restart'() {
            console.info('RESTARTING SERVER')
            process.exit(0)
        },
    })
}