lib/helpers/hydrater.js
function(err, changes) {
          if(cleaner.called) {
            return;
          }

          cleaner.called = true;
          if(err) {
            // Build a custom extra object, with hydration error details
            var extra = JSON.parse(JSON.stringify(task));
            extra.changes = changes;
            extra.stdout = stdout;
            extra.stderr = stderr;

            logError(err, extra);
            child.reset();
          }
          else {
            // Make the child available again
            child.available = true;
          }

          cb(err, changes);

          if(stdout !== "") {
            loggingTask.std = "out";
            log.info(loggingTask, stdout);
          }
          if(stderr !== "") {
            loggingTask.std = "err";
            log.info(loggingTask, stderr);
          }
          clearTimeout(timeout);
        }
function(err, changes) {
          if(cleaner.called) {
            return;
          }

          cleaner.called = true;
          if(err) {
            // Build a custom extra object, with hydration error details
            var extra = JSON.parse(JSON.stringify(task));
            extra.changes = changes;
            extra.stdout = stdout;
            extra.stderr = stderr;

            logError(err, extra);
            child.reset();
          }
          else {
            // Make the child available again
            child.available = true;
          }

          cb(err, changes);

          if(stdout !== "") {
            loggingTask.std = "out";
            log.info(loggingTask, stdout);
          }
          if(stderr !== "") {
            loggingTask.std = "err";
            log.info(loggingTask, stderr);
          }
          clearTimeout(timeout);
        }
function ( err , changes ) { if ( cleaner . called ) { return ; } cleaner . called = true ; if ( err ) { // Build a custom extra object, with hydration error details var extra = JSON . parse ( JSON . stringify ( task ) ) ; extra . changes = changes ; extra . stdout = stdout ; extra . stderr = stderr ; logError ( err , extra ) ; child . reset ( ) ; } else { // Make the child available again child . available = true ; } cb ( err , changes ) ; if ( stdout !== "" ) { loggingTask . std = "out" ; log . info ( loggingTask , stdout ) ; } if ( stderr !== "" ) { loggingTask . std = "err" ; log . info ( loggingTask , stderr ) ; } clearTimeout ( timeout ) ; }
Function to call, either on domain error, on hydration error or successful hydration.
Function to call either on domain error on hydration error or successful hydration .