mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
@@ -8,14 +8,14 @@ export const mongoSessionRun = async <T = unknown>(fn: (session: ClientSession)
|
||||
const result = await fn(session);
|
||||
|
||||
await session.commitTransaction();
|
||||
session.endSession();
|
||||
await session.endSession();
|
||||
|
||||
return result as T;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
await session.abortTransaction();
|
||||
session.endSession();
|
||||
await session.endSession();
|
||||
return Promise.reject(error);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user