Réécriture complète 4.0
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build and Push Docker Image / build-and-push (push) Failing after 6m16s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build and Push Docker Image / build-and-push (push) Failing after 6m16s
				
			This commit is contained in:
		| @@ -1,8 +1,6 @@ | ||||
| import chalk from 'chalk' | ||||
| import { logConsole } from "@/utils/console" | ||||
|  | ||||
| export default { | ||||
| 	name: 'connected', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Connected to MongoDB !')) | ||||
| 	} | ||||
| } | ||||
| export const name = "connected" | ||||
| export function execute() { | ||||
| 	logConsole('mongoose', 'connected') | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| import chalk from 'chalk' | ||||
| import { logConsole } from "@/utils/console" | ||||
|  | ||||
| export default { | ||||
| 	name: 'connecting', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Connecting to MongoDB...')) | ||||
| 	} | ||||
| } | ||||
| export const name = "connecting" | ||||
| export function execute() { | ||||
| 	logConsole('mongoose', 'connecting') | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| import chalk from 'chalk' | ||||
| import { logConsole } from "@/utils/console" | ||||
|  | ||||
| export default { | ||||
| 	name: 'disconnected', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Disconnected from MongoDB !')) | ||||
| 	} | ||||
| } | ||||
| export const name = "disconnected" | ||||
| export function execute() { | ||||
| 	logConsole('mongoose', 'disconnected') | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| import chalk from 'chalk' | ||||
| import { logConsoleError } from "@/utils/console" | ||||
|  | ||||
| export default { | ||||
| 	name: 'error', | ||||
| 	async execute(error: Error) { | ||||
| 		console.log(chalk.red('[Mongoose] An error occured with the database conenction :\n' + error)) | ||||
| 	} | ||||
| } | ||||
| export const name = "error" | ||||
| export function execute(error: Error) { | ||||
| 	logConsoleError('mongoose', 'error', { message: error.message }, error) | ||||
| } | ||||
|   | ||||
							
								
								
									
										13
									
								
								src/events/mongo/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/events/mongo/index.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| import * as connected from "./connected" | ||||
| import * as connecting from "./connecting" | ||||
| import * as disconnected from "./disconnected" | ||||
| import * as error from "./error" | ||||
|  | ||||
| import type { Event } from "@/types" | ||||
|  | ||||
| export default [ | ||||
| 	connected, | ||||
| 	connecting, | ||||
| 	disconnected, | ||||
| 	error | ||||
| ] as Event[] | ||||
		Reference in New Issue
	
	Block a user