@@ -429,9 +429,8 @@ export function createApp(options: AppOptions) {
429429 async ( c ) => {
430430 const { id } = c . req . valid ( 'param' )
431431 const { state_limit, time_limit, sync_run_id, no_state } = c . req . valid ( 'query' )
432- const body = ( ( c . req . valid ( 'json' ) as z . infer < typeof SyncBodySchema > | undefined ) ?? { } ) as z . infer <
433- typeof SyncBodySchema
434- >
432+ const body = ( ( c . req . valid ( 'json' ) as z . infer < typeof SyncBodySchema > | undefined ) ??
433+ { } ) as z . infer < typeof SyncBodySchema >
435434
436435 let pipeline : Pipeline
437436 try {
@@ -483,8 +482,7 @@ export function createApp(options: AppOptions) {
483482 type : 'log' as const ,
484483 log : {
485484 level : 'error' as const ,
486- message :
487- err instanceof Error ? err . message : `Sync failed: ${ String ( err ) } ` ,
485+ message : err instanceof Error ? err . message : `Sync failed: ${ String ( err ) } ` ,
488486 } ,
489487 } ) ,
490488 } )
@@ -506,8 +504,14 @@ export function createApp(options: AppOptions) {
506504 requestParams : {
507505 path : PipelineIdParam ,
508506 query : z . object ( {
509- state_limit : z . coerce . number ( ) . optional ( ) . meta ( { description : 'Max state messages per iteration' } ) ,
510- time_limit : z . coerce . number ( ) . optional ( ) . meta ( { description : 'Time limit per iteration (seconds)' } ) ,
507+ state_limit : z . coerce
508+ . number ( )
509+ . optional ( )
510+ . meta ( { description : 'Max state messages per iteration' } ) ,
511+ time_limit : z . coerce
512+ . number ( )
513+ . optional ( )
514+ . meta ( { description : 'Time limit per iteration (seconds)' } ) ,
511515 } ) ,
512516 } ,
513517 responses : {
@@ -548,16 +552,12 @@ export function createApp(options: AppOptions) {
548552 } )
549553
550554 const syncRunId = crypto . randomUUID ( )
551- const result = await runBackfillToCompletion (
552- { pipelineSync : activities . pipelineSync } ,
553- id ,
554- {
555- syncState : pipeline . sync_state ?? emptySyncState ( ) ,
556- syncRunId,
557- stateLimit : state_limit ?? 100 ,
558- timeLimit : time_limit ?? 30 ,
559- }
560- )
555+ const result = await runBackfillToCompletion ( { pipelineSync : activities . pipelineSync } , id , {
556+ syncState : pipeline . sync_state ?? emptySyncState ( ) ,
557+ syncRunId,
558+ stateLimit : state_limit ?? 100 ,
559+ timeLimit : time_limit ?? 30 ,
560+ } )
561561
562562 return c . json ( { eof : result . eof , sync_state : result . syncState } , 200 )
563563 }
0 commit comments