@@ -173,43 +173,25 @@ protec.use(async (action, clientSessionId, ws, userInfo) => {
173173 if ( orgLookup . found && orgLookup . organizationId ) {
174174 // Check and trigger organization auto top-up if needed
175175 try {
176- logger . info (
177- {
178- organizationId : orgLookup . organizationId ,
179- organizationName : orgLookup . organizationName ,
180- userId,
181- repoUrl,
182- action : 'starting_org_auto_topup_check'
183- } ,
184- 'Starting organization auto top-up check in middleware'
185- )
186-
187176 await checkAndTriggerOrgAutoTopup ( orgLookup . organizationId , userId )
188-
189- logger . debug (
190- {
191- organizationId : orgLookup . organizationId ,
192- organizationName : orgLookup . organizationName ,
193- userId,
194- repoUrl,
195- action : 'completed_org_auto_topup_check'
196- } ,
197- 'Successfully completed organization auto top-up check in middleware'
198- )
199177 } catch ( error ) {
200178 logger . error (
201- {
202- error : error instanceof Error ? {
203- name : error . name ,
204- message : error . message ,
205- stack : error . stack
206- } : error ,
207- organizationId : orgLookup . organizationId ,
179+ {
180+ error :
181+ error instanceof Error
182+ ? {
183+ name : error . name ,
184+ message : error . message ,
185+ stack : error . stack ,
186+ }
187+ : error ,
188+ organizationId : orgLookup . organizationId ,
208189 organizationName : orgLookup . organizationName ,
209- userId,
190+ userId,
210191 repoUrl,
211192 action : 'failed_org_auto_topup_check' ,
212- errorType : error instanceof Error ? error . constructor . name : typeof error
193+ errorType :
194+ error instanceof Error ? error . constructor . name : typeof error ,
213195 } ,
214196 'Error during organization auto top-up check in middleware'
215197 )
@@ -324,38 +306,23 @@ protec.use(async (action, clientSessionId, ws, userInfo) => {
324306 // Check if we need to trigger auto top-up and get the amount added (if any)
325307 let autoTopupAdded : number | undefined = undefined
326308 try {
327- logger . debug (
328- {
329- userId,
330- clientSessionId,
331- action : 'starting_user_auto_topup_check'
332- } ,
333- 'Starting user auto top-up check in middleware'
334- )
335-
336309 autoTopupAdded = await checkAndTriggerAutoTopup ( userId )
337-
338- logger . debug (
339- {
340- userId,
341- clientSessionId,
342- autoTopupAdded,
343- action : 'completed_user_auto_topup_check'
344- } ,
345- 'Successfully completed user auto top-up check in middleware'
346- )
347310 } catch ( error ) {
348311 logger . error (
349- {
350- error : error instanceof Error ? {
351- name : error . name ,
352- message : error . message ,
353- stack : error . stack
354- } : error ,
355- userId,
312+ {
313+ error :
314+ error instanceof Error
315+ ? {
316+ name : error . name ,
317+ message : error . message ,
318+ stack : error . stack ,
319+ }
320+ : error ,
321+ userId,
356322 clientSessionId,
357323 action : 'failed_user_auto_topup_check' ,
358- errorType : error instanceof Error ? error . constructor . name : typeof error
324+ errorType :
325+ error instanceof Error ? error . constructor . name : typeof error ,
359326 } ,
360327 'Error during auto top-up check in middleware'
361328 )
0 commit comments