File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,20 @@ exports.handler = async function singerTarget({
101101 const clearedSheets = new Set ( ) ;
102102 const writtenStreams = new Set ( ) ;
103103 for await ( const { type, stream, ...message } of readMessages ( { jsonlFile } ) ) {
104- const sheet = sheets [ stream ] ;
105-
106104 console . log ( `${ type } \t${ stream } ` , message ) ;
107105
108106
107+ // ignore state for now
108+ if ( type == 'STATE' ) {
109+ console . warn ( 'ignoring STATE message' ) ;
110+ continue ;
111+ }
112+
113+
114+ // get sheet
115+ const sheet = sheets [ stream ] ;
116+
117+
109118 // create schema if needed
110119 if ( ! sheet ) {
111120 if ( type == 'SCHEMA' ) {
@@ -129,13 +138,6 @@ exports.handler = async function singerTarget({
129138 }
130139
131140
132- // ignore state for now
133- if ( type == 'STATE' ) {
134- console . warn ( 'ignoring STATE message' ) ;
135- continue ;
136- }
137-
138-
139141 // handle record message
140142 if ( type == 'RECORD' ) {
141143 if ( deleteMissing && ! clearedSheets . has ( sheet ) ) {
You can’t perform that action at this time.
0 commit comments