@naturalcycles/datastore-lib 3.32.0 → 3.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datastore.db.js +7 -1
- package/package.json +1 -1
- package/src/datastore.db.ts +6 -1
package/dist/datastore.db.js
CHANGED
|
@@ -393,7 +393,13 @@ class DatastoreDBTransaction {
|
|
|
393
393
|
this.tx = tx;
|
|
394
394
|
}
|
|
395
395
|
async rollback() {
|
|
396
|
-
|
|
396
|
+
try {
|
|
397
|
+
await this.tx.rollback();
|
|
398
|
+
}
|
|
399
|
+
catch (err) {
|
|
400
|
+
// log the error, but don't re-throw, as this should be a graceful rollback
|
|
401
|
+
this.db.cfg.logger.error(err);
|
|
402
|
+
}
|
|
397
403
|
}
|
|
398
404
|
async getByIds(table, ids, opt) {
|
|
399
405
|
return await this.db.getByIds(table, ids, { ...opt, tx: this });
|
package/package.json
CHANGED
package/src/datastore.db.ts
CHANGED
|
@@ -564,7 +564,12 @@ export class DatastoreDBTransaction implements DBTransaction {
|
|
|
564
564
|
) {}
|
|
565
565
|
|
|
566
566
|
async rollback(): Promise<void> {
|
|
567
|
-
|
|
567
|
+
try {
|
|
568
|
+
await this.tx.rollback()
|
|
569
|
+
} catch (err) {
|
|
570
|
+
// log the error, but don't re-throw, as this should be a graceful rollback
|
|
571
|
+
this.db.cfg.logger.error(err)
|
|
572
|
+
}
|
|
568
573
|
}
|
|
569
574
|
|
|
570
575
|
async getByIds<ROW extends ObjectWithId>(
|