Skip to content

Restart service documentation didn't work #70

@gaieges

Description

@gaieges

Attempting to restart a process via the documentation in the README doesn't seem to work as expected (watch function gets called, but process doesn't get restarted). Instead I discovered that the below works well. Not sure if the documentation is off, or I'm doing something wrong, so I wanted to open a issue before a PR.

node: v10.1.0

The one that worked in restarting the process was:

gulp.task('serve', function () {
    var server = gls('app/app.js');
    server.start();

    gulp.watch('app/**/*', function (file) {
      console.log('reloading..');

      // doesnt work - comes from doc
      // server.notify.apply(server, [file]);

      // works
      server.start.bind(server)();
    });

    // unnecessary since file matches above watch glob
    // gulp.watch('app/app.js', server.start.bind(server));
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions