mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
Align with comments
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
name: "Check Backend Pull Request"
|
name: "Check Backend Pull Request"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # remove me
|
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ export const initDatabase = (MONGO_URL: string) => {
|
|||||||
mongoose
|
mongoose
|
||||||
.connect(MONGO_URL)
|
.connect(MONGO_URL)
|
||||||
.then(() => console.log('Successfully connected to DB'))
|
.then(() => console.log('Successfully connected to DB'))
|
||||||
.catch((e) => {
|
.catch((e) => console.log('Failed to connect to DB ', e));
|
||||||
console.log('Failed to connect to DB ', e);
|
|
||||||
setTimeout(() => {
|
|
||||||
console.log(e);
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
return mongoose.connection;
|
return mongoose.connection;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ export const setUpHealthEndpoint = <T>(server: T) => {
|
|||||||
const onSignal = () => {
|
const onSignal = () => {
|
||||||
console.log('Server is starting clean-up');
|
console.log('Server is starting clean-up');
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
() => {
|
new Promise((resolve) => {
|
||||||
if (mongoose.connection && mongoose.connection.readyState == 1) {
|
if (mongoose.connection && mongoose.connection.readyState == 1) {
|
||||||
mongoose.connection.close();
|
mongoose.connection.close()
|
||||||
() => {
|
.then(() => resolve('Database connection closed'));
|
||||||
console.info('Database connection closed');
|
} else {
|
||||||
};
|
resolve('Database connection already closed');
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user