lib/ishiki.js
function stopDrone(userid, appid, callback) {
    droneModel.getProcessed({user: userid, name: appid}, function(err, result) {
      if (err)
        return callback(err);

      if (result.length == 1) {
        if (!result[0].started) {
          callback({message: 'Drone is already stopped'});
        }else{
          //need to namespace apps to allow for two users with same app name
          drone.stop(appid, function(err, response) {
            if (err)
              return callback(err);

            result[0].started = false;
            callback(null, result[0]);
          });
        }
      }else{
        callback({message: 'No drone matching ' + userid + '/' + appid});
      }
    });
  }
function stopDrone(userid, appid, callback) {
    droneModel.getProcessed({user: userid, name: appid}, function(err, result) {
      if (err)
        return callback(err);

      if (result.length == 1) {
        if (!result[0].started) {
          callback({message: 'Drone is already stopped'});
        }else{
          //need to namespace apps to allow for two users with same app name
          drone.stop(appid, function(err, response) {
            if (err)
              return callback(err);

            result[0].started = false;
            callback(null, result[0]);
          });
        }
      }else{
        callback({message: 'No drone matching ' + userid + '/' + appid});
      }
    });
  }
function stopDrone ( userid , appid , callback ) { droneModel . getProcessed ( { user : userid , name : appid } , function ( err , result ) { if ( err ) return callback ( err ) ; if ( result . length == 1 ) { if ( ! result [ 0 ] . started ) { callback ( { message : 'Drone is already stopped' } ) ; } else { //need to namespace apps to allow for two users with same app name drone . stop ( appid , function ( err , response ) { if ( err ) return callback ( err ) ; result [ 0 ] . started = false ; callback ( null , result [ 0 ] ) ; } ) ; } } else { callback ( { message : 'No drone matching ' + userid + '/' + appid } ) ; } } ) ; }
stops a drone
stops a drone