@oliasoft-open-source/node-json-migrator 2.3.7-beta-2 → 2.3.7
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/plan/plan.js +7 -1
- package/package.json +1 -1
package/dist/plan/plan.js
CHANGED
|
@@ -135,6 +135,12 @@ const loadMigrationFunctions = async (sortedMigrationEntries, nextVersion, impor
|
|
|
135
135
|
const cachedPlannedVersion = (0, _cachedPlannedVersion.getCachedPlannedVersion)();
|
|
136
136
|
const cachedMigratorFunctions = (0, _cachedPlannedVersion.getCachedMigratorFunctions)();
|
|
137
137
|
const cacheValid = cachedPlannedVersion === nextVersion && sortedMigrationEntries.length === cachedMigratorFunctions.length;
|
|
138
|
+
/*
|
|
139
|
+
OW-15584 the module-from-string package seems to have a memory leak bug
|
|
140
|
+
where calling importFromString multiple times consumes memory that
|
|
141
|
+
doesn't get released or garbage collected. We cache the imported strings
|
|
142
|
+
as a workaround (until plan.json version changes)
|
|
143
|
+
*/
|
|
138
144
|
const migrationFunctions = cacheValid ? cachedMigratorFunctions : await Promise.all(sortedMigrationEntries.map(async m => {
|
|
139
145
|
const {
|
|
140
146
|
script
|
|
@@ -254,7 +260,7 @@ const getPlannedMigrations = async ({
|
|
|
254
260
|
}];
|
|
255
261
|
await (0, _database.insertVersions)(database, pgpHelpers, entity, versionRecord);
|
|
256
262
|
}
|
|
257
|
-
const plannedMigrationsWithFunctions = await loadMigrationFunctions(
|
|
263
|
+
const plannedMigrationsWithFunctions = await loadMigrationFunctions(plannedMigrationsWithHistory, nextVersion, importModule);
|
|
258
264
|
return {
|
|
259
265
|
plannedMigrations: plannedMigrationsWithFunctions,
|
|
260
266
|
nextVersion
|
package/package.json
CHANGED