Skip to content

Commit

Permalink
refactor: avoid adding schemas to AJV
Browse files Browse the repository at this point in the history
to avoid memory leak
  • Loading branch information
danielpeintner committed Apr 15, 2024
1 parent d2d7833 commit 071eb1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/interaction-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const { debug, warn } = createLoggers("core", "interaction-output");

// Strict mode has a lot of other checks and it prevents runtime unexpected problems
// TODO: in the future we should use the strict mode
const ajv = new Ajv({ strict: false });
// addUsedSchema may cause memory leak in our use-case / environment (see https://github.com/eclipse-thingweb/node-wot/issues/1062)
const ajv = new Ajv({ strict: false, addUsedSchema: false });
addFormats(ajv);

export class InteractionOutput implements WoT.InteractionOutput {
Expand Down

0 comments on commit 071eb1f

Please sign in to comment.