Commit ee279828 authored by Johannes Bill's avatar Johannes Bill

replaced mysql connection by connection pool, which handles automatic...

replaced mysql connection by connection pool, which handles automatic connection losts by inactivity
parent 3cb00d56
...@@ -19,7 +19,7 @@ var blndMapping = { ...@@ -19,7 +19,7 @@ var blndMapping = {
"Mecklenburg-Vorpommern": "MV", "Mecklenburg-Vorpommern": "MV",
"Thüringen": "TH" "Thüringen": "TH"
}; };
var connection = mysql.createConnection(config["mysqlConfig"]); var connection = mysql.createPool(config["mysqlConfig"]);
module.exports.getBundesland = function(plz, cb) { module.exports.getBundesland = function(plz, cb) {
connection.query("SELECT bundesland FROM postleitzahlen WHERE plz = '" + plz + "'", function (err, result) { connection.query("SELECT bundesland FROM postleitzahlen WHERE plz = '" + plz + "'", function (err, result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment