Skip to content
Snippets Groups Projects
Commit 408c933f authored by Iskandar, Michelle P (UG - Computer Science)'s avatar Iskandar, Michelle P (UG - Computer Science) :ice_skate:
Browse files

remove closing db

parent ad290b8c
No related branches found
No related tags found
No related merge requests found
...@@ -52,8 +52,6 @@ app.post('/predict', (req,res) => { ...@@ -52,8 +52,6 @@ app.post('/predict', (req,res) => {
// Insert the record to the collection, throw error if insert unsuccessful // Insert the record to the collection, throw error if insert unsuccessful
collection.insert(rec, {w:1}, function(err, result) {}); collection.insert(rec, {w:1}, function(err, result) {});
}, function(){
db.close();
}); });
res.render('predictions',{predictions:JSON.parse(JSON.parse(body).predictionText)}) res.render('predictions',{predictions:JSON.parse(JSON.parse(body).predictionText)})
...@@ -74,7 +72,6 @@ app.get('/submissions', function (req, res) { ...@@ -74,7 +72,6 @@ app.get('/submissions', function (req, res) {
cursor.forEach(function(doc, err){ cursor.forEach(function(doc, err){
resultArray.push(doc) resultArray.push(doc)
}, function(){ }, function(){
db.close();
res.render('submissions', {items: resultArray}); res.render('submissions', {items: resultArray});
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment