File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { NotFoundError } from '@latitude-data/core/lib/errors'
4
4
import { getUnknownError } from '@latitude-data/core/lib/getUnknownError'
5
5
import { captureException } from '$/utils/sentry'
6
6
import { Processor } from 'bullmq'
7
- import tracer from '../tracer '
7
+ import * as Sentry from '@sentry/node '
8
8
9
9
export const buildProcessor =
10
10
( queues : Queues [ ] ) : Processor =>
@@ -18,18 +18,16 @@ export const buildProcessor =
18
18
const jobFn = ( jobs as unknown as Record < string , Function > ) [ j ]
19
19
if ( jobFn ) {
20
20
try {
21
- return await tracer . wrap (
22
- 'bull.process' ,
23
- { resource : job . name } ,
21
+ Sentry . profiler . startProfiler ( )
22
+ const result = await Sentry . startSpan (
23
+ { name : job . name } ,
24
24
async ( ) => {
25
- const span = tracer . scope ( ) . active ( )
26
- if ( span ) {
27
- span . addTags ( { job_id : job . id } )
28
- }
29
-
30
25
return await jobFn ( job )
31
26
} ,
32
- ) ( )
27
+ )
28
+ Sentry . profiler . stopProfiler ( )
29
+
30
+ return result
33
31
} catch ( error ) {
34
32
const unknownError = getUnknownError ( error )
35
33
You can’t perform that action at this time.
0 commit comments