File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/datadog-instrumentations/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -372,17 +372,22 @@ addHook({
372
372
return suitePackage
373
373
} )
374
374
375
+ const processToHandler = new WeakMap ( )
376
+
375
377
addHook ( {
376
378
name : 'tinypool' ,
377
379
versions : [ '>=1.0.0' ] ,
378
380
file : 'dist/index.js'
379
381
} , ( TinyPool ) => {
380
- debugger
381
382
// we can pass handle here to the worker, and then use it to send messages to the main process
382
383
shimmer . wrap ( TinyPool . prototype , 'run' , run => function ( _ , { channel } ) {
383
384
const res = run . apply ( this , arguments )
384
385
385
386
this . threads . forEach ( thread => {
387
+ if ( processToHandler . has ( thread . process ) ) {
388
+ return
389
+ }
390
+ processToHandler . set ( thread . process , true )
386
391
thread . process . on ( 'message' , ( message ) => {
387
392
if ( message . __tinypool_worker_message__ && message . data ) {
388
393
workerReporterCh . publish ( message . data )
You can’t perform that action at this time.
0 commit comments