Skip to content

Commit

Permalink
Merge pull request #83 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: v0.21.4
  • Loading branch information
themightychris authored Jan 30, 2022
2 parents a664af7 + 71d7b46 commit e859b37
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions backend/commands/singer-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,20 @@ exports.handler = async function singerTarget({
const clearedSheets = new Set();
const writtenStreams = new Set();
for await (const { type, stream, ...message} of readMessages({ jsonlFile })) {
const sheet = sheets[stream];

console.log(`${type}\t${stream}`, message);


// ignore state for now
if (type == 'STATE') {
console.warn('ignoring STATE message');
continue;
}


// get sheet
const sheet = sheets[stream];


// create schema if needed
if (!sheet) {
if (type == 'SCHEMA') {
Expand All @@ -129,13 +138,6 @@ exports.handler = async function singerTarget({
}


// ignore state for now
if (type == 'STATE') {
console.warn('ignoring STATE message');
continue;
}


// handle record message
if (type == 'RECORD') {
if (deleteMissing && !clearedSheets.has(sheet)) {
Expand Down

0 comments on commit e859b37

Please sign in to comment.