Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

await will generate new tracerId #137

Open
yufeifan opened this issue Sep 22, 2020 · 0 comments
Open

await will generate new tracerId #137

yufeifan opened this issue Sep 22, 2020 · 0 comments

Comments

@yufeifan
Copy link

my code is

server.get("/serverB", async function (req, res) {
  let mysql = require("mysql");

  await querySleep(1);
  await querySleep(1);

  res.writeHead(200, { "Content-Type": "text/html" });
  res.write("<html><body><p>This is student Page.</p></body></html>");
  res.end();
});

async function querySleep(time) {
  return new Promise(function (resolve, rej) {
    connection.query("SELECT SLEEP(1)", function (error, results, fields) {
      if (error) throw rej(error);
      resolve("");
    });
  });
}

then the web show:
image

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

No branches or pull requests

1 participant