@@ -70,7 +70,7 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
7070 processManager . kill ( )
7171 const errorMessage = `Step execution timed out after ${ timeoutSeconds } seconds`
7272 logger . error ( errorMessage , { step : step . config . name , timeout : timeoutSeconds } )
73- await tracer . end ( { message : errorMessage } )
73+ tracer . end ( { message : errorMessage } )
7474 trackEvent ( 'step_execution_timeout' , {
7575 stepName : step . config . name ,
7676 traceId,
@@ -94,7 +94,7 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
9494 message : err . message ,
9595 } )
9696
97- await tracer . end ( {
97+ tracer . end ( {
9898 message : err . message ,
9999 code : err . code ,
100100 stack : err . stack ?. replace ( new RegExp ( `${ motia . lockedData . baseDir } /` ) , '' ) ,
@@ -104,35 +104,35 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
104104
105105 reject ( error )
106106 } else {
107- await tracer . end ( )
107+ tracer . end ( )
108108 }
109109
110110 processManager . kill ( )
111111 } )
112112 processManager . handler < unknown > ( 'log' , async ( input : unknown ) => logger . log ( input ) )
113113
114114 processManager . handler < StateGetInput , unknown > ( 'state.get' , async ( input ) => {
115- await tracer . stateOperation ( 'get' , input )
115+ tracer . stateOperation ( 'get' , input )
116116 return motia . state . get ( input . traceId , input . key )
117117 } )
118118
119119 processManager . handler < StateSetInput , unknown > ( 'state.set' , async ( input ) => {
120- await tracer . stateOperation ( 'set' , { traceId : input . traceId , key : input . key , value : input . value } )
120+ tracer . stateOperation ( 'set' , { traceId : input . traceId , key : input . key , value : input . value } )
121121 return motia . state . set ( input . traceId , input . key , input . value )
122122 } )
123123
124124 processManager . handler < StateDeleteInput , unknown > ( 'state.delete' , async ( input ) => {
125- await tracer . stateOperation ( 'delete' , input )
125+ tracer . stateOperation ( 'delete' , input )
126126 return motia . state . delete ( input . traceId , input . key )
127127 } )
128128
129129 processManager . handler < StateClearInput , void > ( 'state.clear' , async ( input ) => {
130- await tracer . stateOperation ( 'clear' , input )
130+ tracer . stateOperation ( 'clear' , input )
131131 return motia . state . clear ( input . traceId )
132132 } )
133133
134134 processManager . handler < StateStreamGetInput > ( `state.getGroup` , async ( input ) => {
135- await tracer . stateOperation ( 'getGroup' , input )
135+ tracer . stateOperation ( 'getGroup' , input )
136136 return motia . state . getGroup ( input . groupId )
137137 } )
138138
@@ -149,39 +149,39 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
149149 const flows = step . config . flows
150150
151151 if ( ! isAllowedToEmit ( step , input . topic ) ) {
152- await tracer . emitOperation ( input . topic , input . data , false )
152+ tracer . emitOperation ( input . topic , input . data , false )
153153 return motia . printer . printInvalidEmit ( step , input . topic )
154154 }
155155
156- await tracer . emitOperation ( input . topic , input . data , true )
156+ tracer . emitOperation ( input . topic , input . data , true )
157157 return motia . eventAdapter . emit ( { ...input , traceId, flows, logger, tracer } )
158158 } )
159159
160160 Object . entries ( streamConfig ) . forEach ( ( [ name , streamFactory ] ) => {
161161 const stateStream = streamFactory ( )
162162
163163 processManager . handler < StateStreamGetInput > ( `streams.${ name } .get` , async ( input ) => {
164- await tracer . streamOperation ( name , 'get' , input )
164+ tracer . streamOperation ( name , 'get' , input )
165165 return stateStream . get ( input . groupId , input . id )
166166 } )
167167
168168 processManager . handler < StateStreamMutateInput > ( `streams.${ name } .set` , async ( input ) => {
169- await tracer . streamOperation ( name , 'set' , { groupId : input . groupId , id : input . id , data : input . data } )
169+ tracer . streamOperation ( name , 'set' , { groupId : input . groupId , id : input . id , data : input . data } )
170170 return stateStream . set ( input . groupId , input . id , input . data )
171171 } )
172172
173173 processManager . handler < StateStreamGetInput > ( `streams.${ name } .delete` , async ( input ) => {
174- await tracer . streamOperation ( name , 'delete' , input )
174+ tracer . streamOperation ( name , 'delete' , input )
175175 return stateStream . delete ( input . groupId , input . id )
176176 } )
177177
178178 processManager . handler < StateStreamGetInput > ( `streams.${ name } .getGroup` , async ( input ) => {
179- await tracer . streamOperation ( name , 'getGroup' , input )
179+ tracer . streamOperation ( name , 'getGroup' , input )
180180 return stateStream . getGroup ( input . groupId )
181181 } )
182182
183183 processManager . handler < StateStreamSendInput > ( `streams.${ name } .send` , async ( input ) => {
184- await tracer . streamOperation ( name , 'send' , input )
184+ tracer . streamOperation ( name , 'send' , input )
185185 return stateStream . send ( input . channel , input . event )
186186 } )
187187 } )
@@ -203,19 +203,19 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
203203
204204 if ( code !== 0 && code !== null ) {
205205 const error = { message : `Process exited with code ${ code } ` , code }
206- await tracer . end ( error )
206+ tracer . end ( error )
207207 trackEvent ( 'step_execution_error' , { stepName : step . config . name , traceId, code } )
208208 reject ( `Process exited with code ${ code } ` )
209209 } else {
210- await tracer . end ( )
210+ tracer . end ( )
211211 resolve ( result )
212212 }
213213 } )
214214
215215 processManager . onProcessError ( async ( error ) => {
216216 if ( timeoutId ) clearTimeout ( timeoutId )
217217 processManager . close ( )
218- await tracer . end ( {
218+ tracer . end ( {
219219 message : error . message ,
220220 code : error . code ,
221221 stack : error . stack ,
@@ -236,7 +236,7 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
236236 } )
237237 . catch ( async ( error ) => {
238238 if ( timeoutId ) clearTimeout ( timeoutId )
239- await tracer . end ( {
239+ tracer . end ( {
240240 message : error . message ,
241241 code : error . code ,
242242 stack : error . stack ,
@@ -253,7 +253,7 @@ export const callStepFile = <TData>(options: CallStepFileOptions, motia: Motia):
253253 } )
254254 } catch ( error : unknown ) {
255255 const err = error as Error & { code ?: string }
256- await tracer . end ( {
256+ tracer . end ( {
257257 message : err . message ,
258258 code : err . code ,
259259 stack : err . stack ,
0 commit comments