Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You're not logged in error after executing a command successfully #292

Open
masterpreenz opened this issue Sep 10, 2018 · 0 comments
Open

Comments

@masterpreenz
Copy link

I find this really odd when I do

queue.push({}, function () {
    Ftp.get('data.json', function (err, socket) {
      if (err) {
        throw 'Error accessing data server, please try again';
        return;
      }

      socket.on('data', d => {
        data += d.toString();
      });

      socket.on('close', err => {
        if (err) {
          console.log('There was an error retrieving the file');
          return;
        }

        data = JSON.parse(data);
        emitData('data-loaded', data);
      });

      socket.resume();
    });
  });

This one works but if I do a follow up:

  queue.push({name: "client"}, function () {
    Ftp.ls("client", (err, res) => {
      if (err) {
        console.log(err);
        return;
      }

      console.log(res);
    });
  });

I get a You're not logged in error though I have managed to fix this problem by Logging in again

function loginFTP() {
  Ftp = new jsftp({
    host: 'xxxxx',
    port: 21,
    user: 'xxxxx',
    pass: 'xxxxx',
    useList: true
  });
}

function queueLogin() {
  queue.push({name: 'login'}, function () {
    loginFTP();
  });
}

Every after I do an action but I think it's wrong of there's something wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant