How to use the forever.cleanUp function in forever

To help you get started, we’ve selected a few forever examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lazojs / lazo / run.js View on Github external
function stop() {
    var forever = require('forever'),
        fsx = require('fs-extra');

    console.log('Stopping Lazo!...');
    if (fsx.existsSync(lazoPath + '/lazo.pid')) {
        try {
            forever.stop('lib/server/app.js', true);
            forever.cleanUp();
            fsx.remove(lazoPath + '/lazo.pid');
            console.log('Lazo! stopped');
        } catch (err) {
            console.log('Error stopping Lazo!');
            process.exit(1);
        }
    }
}

forever

A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis