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

Error -> Request Time-out #925

Open
IrfanMaulana00 opened this issue Jul 14, 2024 · 3 comments
Open

Error -> Request Time-out #925

IrfanMaulana00 opened this issue Jul 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@IrfanMaulana00
Copy link

i got error Request Time-out when restart my server.
how to solve this error ?

Screenshot_125
@IrfanMaulana00 IrfanMaulana00 added the bug Something isn't working label Jul 14, 2024
@bobslavtriev
Copy link
Contributor

Problem is in your code!

@IrfanMaulana00
Copy link
Author

Problem is in your code!

I don't know where the problem is, because it happened when I restarted the server, after that it ran smoothly,

this is my code for start device :

  const sessionDir = `./sessions/${deviceNumber}`;
  const storePath = `./sessions/store/${deviceNumber}.json`;
  const qrFile = `./public/qr/${deviceNumber}.png`;
  console.log("Start Device => ", deviceNumber)

  const { state, saveCreds } = await useMultiFileAuthState(sessionDir)

  const options = {
    // printQRInTerminal: true,
    auth: state,
    logger: pino({ level: "silent" }),
    browser: [process.env.APP_NAME, 'Chrome', '1.0.0'],
    qrTimeout: 20000,
    keepAliveIntervalMs: 10000,
    // browser: Browsers.macOS("Safari"),
    // version,
  };

  const store = makeInMemoryStore({});
  store.readFromFile(storePath);

  deviceNumber = makeWASocket.default(options);

  store.readFromFile(storePath);
  setInterval(() => {
    store.writeToFile(storePath);
  }, 10_000);
  store.bind(deviceNumber.ev);

@xbal023
Copy link

xbal023 commented Jul 18, 2024

Problem is in your code!

I don't know where the problem is, because it happened when I restarted the server, after that it ran smoothly,

this is my code for start device :

  const sessionDir = `./sessions/${deviceNumber}`;
  const storePath = `./sessions/store/${deviceNumber}.json`;
  const qrFile = `./public/qr/${deviceNumber}.png`;
  console.log("Start Device => ", deviceNumber)

  const { state, saveCreds } = await useMultiFileAuthState(sessionDir)

  const options = {
    // printQRInTerminal: true,
    auth: state,
    logger: pino({ level: "silent" }),
    browser: [process.env.APP_NAME, 'Chrome', '1.0.0'],
    qrTimeout: 20000,
    keepAliveIntervalMs: 10000,
    // browser: Browsers.macOS("Safari"),
    // version,
  };

  const store = makeInMemoryStore({});
  store.readFromFile(storePath);

  deviceNumber = makeWASocket.default(options);

  store.readFromFile(storePath);
  setInterval(() => {
    store.writeToFile(storePath);
  }, 10_000);
  store.bind(deviceNumber.ev);

change your browser options. start opening the docs before creating an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants