switch to mongoose
This commit is contained in:
		
							parent
							
								
									f5269ef39e
								
							
						
					
					
						commit
						fb4502bb68
					
				| @ -12,11 +12,12 @@ export class Server { | ||||
| 
 | ||||
| 	async setupSchema() { | ||||
| 		// TODO: adjust expireAfterSeconds -> lower
 | ||||
| 		await db.conn.db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 }); | ||||
| 		await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 }); | ||||
| 	} | ||||
| 
 | ||||
| 	async listen(): Promise<void> { | ||||
| 		await db.init(); | ||||
| 		// @ts-ignore
 | ||||
| 		await (db as Promise<Connection>); | ||||
| 		await this.setupSchema(); | ||||
| 		await Config.init(); | ||||
| 		console.log("listening"); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Flam3rboy
						Flam3rboy