Closed BertCatsburg closed 3 years ago
And also the above problem is reproduced in the same Repo as in bug #121: https://github.com/BertCatsburg/BreeJS-Jobs-exit-before-finished
Alright so I have determined the issue with this. All of your log writes are not actually being awaited
therefore the method is moving on to the finally
and returning done
. This will kill the worker in bree thus it doesn't complete.
In continuation of #109 and #121
I have made a simple reproduction of the problem, this time without console.logs but a simple write to a file. Instead of the console.log (like I did in #121), I do a fs.createWriteStream and file.write to a file.
Very strange thing: The first run is working (messages appear in the output file), but from the second run onwards, no messages appear. It's not a case of overwriting, because I added a timestamp.
Relevant files
scheduler.ts
hello_world_to_file.ts
Result
The output-file shows only the first time the job is run.
But after that nothing is written to the output-file.
No console.log is used in this program.