Skip to content

Commit 9dd6cb4

Browse files
committed
fixing front page bug
1 parent 03ba3cd commit 9dd6cb4

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

Main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ ipcMain.on('overviewRequest', (message, index) => {
126126
const getCommunications = 'SELECT * FROM communications';
127127
pool.query(getCommunications, (err, result) => {
128128
if (err) {
129-
console.log(err);
130129
return message.sender.send(JSON.stringify('Database info could not be retrieved.'));
131130
}
132131
//queryResults is an array of objects with the following keys {"id","currentmicroservice","targetedendpoint","reqtype","resstatus","resmessage","timesent"}
@@ -151,7 +150,7 @@ ipcMain.on('detailsRequest', (message, index) => {
151150
}
152151
const queryResults = JSON.stringify(data);
153152
// Asynchronous event emitter used to transmit query results back to the render process.
154-
message.sender.send('detailsResponse', queryResults);
153+
return message.sender.send('detailsResponse', queryResults);
155154
});
156155
}
157156

@@ -165,7 +164,7 @@ ipcMain.on('detailsRequest', (message, index) => {
165164
}
166165
const queryResults = JSON.stringify(result.rows);
167166
// Asynchronous event emitter used to transmit query results back to the render process.
168-
message.sender.send('detailsResponse', queryResults);
167+
return message.sender.send('detailsResponse', queryResults);
169168
});
170169
}
171170
});

app/components/AddService.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const AddService = () => {
4141
<option value="SQL">SQL</option>
4242
<option value="MongoDB">MongoDB</option>
4343
</select>
44-
{/* {dbState} */}
4544
Database URI:
4645
{/* This is where the uri value is set with setUri */}
4746
<input

model/sql-connect.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ const connectSQL = (i) => {
99
connectionString: URI,
1010
})
1111
//verifying that the connection has been made by stating the time it was connected
12-
pool.query('SELECT NOW()', (err, res) => {
13-
console.log('Database '+services[i][0]+' has been connected at '+res.rows[0].now)
14-
})
12+
// This code could be causing too many request to the database
13+
// pool.query('SELECT NOW()', (err, res) => {
14+
// if(err) return message.sender.send('detailsResponse', JSON.stringify('Did not connect to database',err));
15+
// console.log('Database '+services[i][0]+' has been connected at '+res.rows[0].now)
16+
// })
1517
return pool ;
1618
};
1719

user/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"setupRequired":true,"michelleWasHere":true,"services": [["hard", "coded", "solution"]]}
1+
{"setupRequired":false,"michelleWasHere":false,"services":[["microservice1","SQL","postgres://gymyqkck:KDN5_PWumJO6UorMKuex8LLGBsTlISs8@salt.db.elephantsql.com:5432/gymyqkck"]]}

0 commit comments

Comments
 (0)