mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	feat(docs): basic integration with shared db
This commit is contained in:
		
							parent
							
								
									b00224c63c
								
							
						
					
					
						commit
						b7cb2e6e97
					
				
							
								
								
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -14,6 +14,7 @@ po-*/ | |||||||
| !test/**/*.db | !test/**/*.db | ||||||
| !integration-tests/db/document.db | !integration-tests/db/document.db | ||||||
| !integration-tests/db/config.ini | !integration-tests/db/config.ini | ||||||
|  | !data-docs/document.db | ||||||
| integration-tests/db/log | integration-tests/db/log | ||||||
| integration-tests/db/sessions | integration-tests/db/sessions | ||||||
| integration-tests/db/backup | integration-tests/db/backup | ||||||
| @ -36,4 +37,9 @@ images/app-icons/mac/*.png | |||||||
| /playwright-report/ | /playwright-report/ | ||||||
| /blob-report/ | /blob-report/ | ||||||
| /playwright/.cache/ | /playwright/.cache/ | ||||||
| /playwright/.auth/ | /playwright/.auth/ | ||||||
|  | 
 | ||||||
|  | data-docs/backup | ||||||
|  | data-docs/log | ||||||
|  | data-docs/session | ||||||
|  | data-docs/session_secret.txt | ||||||
| @ -1,25 +1,8 @@ | |||||||
| import cls from "./src/services/cls.js"; |  | ||||||
| import sql_init from "./src/services/sql_init.js"; |  | ||||||
| 
 |  | ||||||
| async function startElectron() { | async function startElectron() { | ||||||
|     await import("./electron-main.js"); |     await import("./electron-main.js"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function initializeDb() { |  | ||||||
|     return new Promise<void>((resolve) => { |  | ||||||
|         cls.init(async () => { |  | ||||||
|             await sql_init.createInitialDatabase(); |  | ||||||
|             sql_init.setDbAsInitialized(); |  | ||||||
|             resolve(); |  | ||||||
|         }); |  | ||||||
|     }) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| async function main() { | async function main() { | ||||||
|     if (!sql_init.isDbInitialized()) { |  | ||||||
|         initializeDb(); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     await startElectron(); |     await startElectron(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran