Skip to content

Commit

Permalink
feat(core): replace sync-request by sync-request-curl to prevent hang…
Browse files Browse the repository at this point in the history
…ing leaked handle
  • Loading branch information
adriencaccia committed Jan 18, 2024
1 parent 87735c5 commit b4659ef
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 212 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"find-up": "^6.3.0",
"form-data": "^4.0.0",
"node-gyp-build": "^4.6.0",
"sync-request": "^6.1.0"
"sync-request-curl": "^2.1.10"
}
}
2 changes: 1 addition & 1 deletion packages/core/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export default defineConfig([
{ file: pkg.module, format: "es", sourcemap: true },
],
plugins: jsPlugins(pkg.version),
external: ["sync-request"],
external: ["sync-request-curl"],
},
]);
2 changes: 1 addition & 1 deletion packages/core/src/mongoMeasurement.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import request from "sync-request";
import request from "sync-request-curl";
import {
InstrumentationStatus,
MongoTracer,
Expand Down
2 changes: 2 additions & 0 deletions packages/vitest-plugin/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ export default defineConfig({
test: {
exclude: ["**/tests/**/*", "**/.rollup.cache/**/*"],
mockReset: true,
// needed for `sync-request-curl` to work, see https://github.com/vitest-dev/vitest/issues/740#issuecomment-1042648373
pool: "forks",
},
});
Loading

0 comments on commit b4659ef

Please sign in to comment.