mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	manual transaction handling for jobs
This commit is contained in:
		| @@ -195,6 +195,7 @@ async function doInTransaction(func) { | ||||
|         await transactionPromise; | ||||
|     } | ||||
|  | ||||
|     let ret = null; | ||||
|     const error = new Error(); // to capture correct stack trace in case of exception | ||||
|  | ||||
|     transactionActive = true; | ||||
| @@ -202,7 +203,7 @@ async function doInTransaction(func) { | ||||
|         try { | ||||
|             await beginTransaction(); | ||||
|  | ||||
|             await func(); | ||||
|             ret = await func(); | ||||
|  | ||||
|             await commit(); | ||||
|  | ||||
| @@ -223,6 +224,8 @@ async function doInTransaction(func) { | ||||
|     if (transactionActive) { | ||||
|         await transactionPromise; | ||||
|     } | ||||
|  | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
| async function isDbUpToDate() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user