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