Page MenuHomePhabricator

D13212.id43958.diff
No OneTemporary

D13212.id43958.diff

diff --git a/keyserver/src/database/migrations.js b/keyserver/src/database/migrations.js
--- a/keyserver/src/database/migrations.js
+++ b/keyserver/src/database/migrations.js
@@ -35,22 +35,39 @@
for (const {
version: idx,
migrationPromise: migration,
+ migrationType,
} of migrations.values()) {
if (idx <= dbVersion) {
continue;
}
try {
- await startTransaction();
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await startTransaction();
+ }
await migration();
await updateDBVersion(idx);
- await commitTransaction();
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await commitTransaction();
+ }
console.log(`(node:${process.pid}) migration ${idx} succeeded.`);
} catch (e) {
const transactionExceptionMessage = String(getMessageForException(e));
console.error(`(node:${process.pid}) migration ${idx} failed.`);
console.error(transactionExceptionMessage);
- await rollbackTransaction();
+
+ if (
+ !migrationType ||
+ migrationType === 'wrap_in_transaction_and_block_requests'
+ ) {
+ await rollbackTransaction();
+ }
return false;
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 9:41 AM (17 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2568321
Default Alt Text
D13212.id43958.diff (1 KB)

Event Timeline