Showing
1 changed file
with
19 additions
and
19 deletions
... | @@ -21,25 +21,25 @@ const connection = mysql.createConnection({ | ... | @@ -21,25 +21,25 @@ const connection = mysql.createConnection({ |
21 | database: conf.database, | 21 | database: conf.database, |
22 | }); | 22 | }); |
23 | // connection.connect(); | 23 | // connection.connect(); |
24 | -// function handleDisconnect() { | 24 | +function handleDisconnect() { |
25 | -// connection.connect(function (err) { | 25 | + connection.connect(function (err) { |
26 | -// if (err) { | 26 | + if (err) { |
27 | -// console.log("error when connecting to db:", err); | 27 | + console.log("error when connecting to db:", err); |
28 | -// setTimeout(handleDisconnect, 4000); | 28 | + setTimeout(handleDisconnect, 4000); |
29 | -// } | 29 | + } |
30 | -// }); | 30 | + }); |
31 | - | 31 | + |
32 | -// connection.on("error", function (err) { | 32 | + connection.on("error", function (err) { |
33 | -// console.log("db error", err); | 33 | + console.log("db error", err); |
34 | -// if (err.code === "PROTOCOL_CONNECTION_LOST") { | 34 | + if (err.code === "PROTOCOL_CONNECTION_LOST") { |
35 | -// return handleDisconnect(); | 35 | + return handleDisconnect(); |
36 | -// } else { | 36 | + } else { |
37 | -// throw err; | 37 | + throw err; |
38 | -// } | 38 | + } |
39 | -// }); | 39 | + }); |
40 | -// } | 40 | +} |
41 | - | 41 | + |
42 | -// handleDisconnect(); | 42 | +handleDisconnect(); |
43 | 43 | ||
44 | app.use(bodyParser.json()); | 44 | app.use(bodyParser.json()); |
45 | app.use(bodyParser.urlencoded({ extended: true })); | 45 | app.use(bodyParser.urlencoded({ extended: true })); | ... | ... |
-
Please register or login to post a comment