@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 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(plannedMigrationsWithFileEntries, nextVersion, importModule);
263
+ const plannedMigrationsWithFunctions = await loadMigrationFunctions(plannedMigrationsWithHistory, nextVersion, importModule);
258
264
  return {
259
265
  plannedMigrations: plannedMigrationsWithFunctions,
260
266
  nextVersion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/node-json-migrator",
3
- "version": "2.3.7-beta-2",
3
+ "version": "2.3.7",
4
4
  "description": "A library for JSON migrations",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/node-postgresql-migrator",
6
6
  "bugs": {