Skip to content

Commit 9768dfd

Browse files
committed
removed error handling from UserModel when connecting to database which caused an error preventing chronos from running Co-authored-by: Jon Cruz
<[email protected]> Co-authored-by: Elena Atencio <[email protected]> Co-authored-by: Iris Wong <[email protected]> Co-authored-by: John Donato <[email protected]>
1 parent 7252878 commit 9768dfd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

electron/databases/mongo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import mongoose from 'mongoose';
33
// Mongoose connection wrapped in function that takes the index of the selected database as the parameter. This index is used to target the correct database for querying.
44
const connectMongoose = async (i:number, URI: string) => {
55
try {
6-
// await mongoose.connection.close();
6+
await mongoose.connection.close();
77
const db = await mongoose.connect(URI);
88

99
return db;

electron/models/UserModel.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ const MONGO_URI = 'mongodb+srv://seconddbtest:[email protected]
33
const mongoose = require('mongoose')
44

55
const db2 = mongoose.createConnection(MONGO_URI)
6-
.then(() => {
7-
console.log('Connected to User database...');
8-
})
9-
.catch(err => {
10-
console.log('Error connecting to User database: ', err);
11-
})
12-
console.log('establishing connection to database');
6+
// .then(() => {
7+
// console.log('Connected to User database...');
8+
// })
9+
// .catch(err => {
10+
// console.log('Error connecting to User database: ', err);
11+
// })
12+
// console.log('establishing connection to database');
1313

1414

1515
const userSchema = new mongoose.Schema({

0 commit comments

Comments
 (0)