Skip to content

Commit d5511d4

Browse files
test webhook
1 parent 8d1699d commit d5511d4

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ npm-debug.log
77
.idea
88
configmap
99
app3
10-
10+
docker-compose.yaml

app2/dbRepo.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const mongoose = require('mongoose');
2+
const dbConnection = process.env.MONGO_CONNECTION;
3+
4+
class DbRepo {
5+
constructor() {
6+
this.connect();
7+
}
8+
9+
async connect() {
10+
try {
11+
if(!dbConnection){
12+
throw new Error("MONGO_CONNECTION should be set in variables");
13+
}
14+
await mongoose.connect(dbConnection);
15+
mongoose.connection.on('error', err => {
16+
this.connectionErrHandler(e)
17+
});
18+
console.log("connected to database")
19+
} catch (e) {
20+
this.connectionErrHandler(e)
21+
}
22+
}
23+
24+
connectionErrHandler(e){
25+
console.error(e);
26+
setTimeout(this.connect(), 10_000);
27+
}
28+
}

app2/index2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ router.get('/getRes', express.json(), async (req, res) => {
2121
return;
2222
}
2323
try {
24-
const results = await (await fetch(`${app1Host}/getResults`)).json();
24+
const results = await (await fetch(`${app1Host}/app1/getResults`)).json();
2525
res.send({results, serviceId});
2626
} catch (e) {
2727
console.error(e)

gitops/single-service/templates/ingress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ spec:
2222
service:
2323
name: app2-service
2424
port:
25-
name: http
25+
name: http

0 commit comments

Comments
 (0)