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
Sun, Dec 29, 5:51 AM (2 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2730881
Default Alt Text
D13212.id43958.diff (1 KB)

Event Timeline