diff --git a/index.ts b/index.ts index 97df84d..e57d706 100644 --- a/index.ts +++ b/index.ts @@ -242,7 +242,6 @@ function initializeStream() { } }); } -initializeStream(); /** pop from the job queue and run it */ async function runJob() { @@ -277,6 +276,7 @@ async function pushJob() { async function main() { try { + initializeStream(); try { await Promise.all([runJob(), pushJob()]); } catch (e) {