metacall / faas

Reimplementation of MetaCall FaaS platform written in TypeScript.
https://dashboard.metacall.io
Apache License 2.0
13 stars 20 forks source link

fix: handled errors on /upload endpoint #21

Closed Creatoon closed 1 year ago

Creatoon commented 1 year ago

Fixed #16

1) Closed the pipe from req to bus boy as If any error occurs, we will stop feeding the data.

2) I offloaded the work of each event (field, file) to work queue, such that if any error occurs then we can pause the processing queue and and finally prevent the bus boy events from firing callbacks on the data that has already been piped.

durgesh077 commented 1 year ago

@Creatoon what about already written files like metacall_json to the disk , You need to delete after error. I was doing first like this but later falled back to try catch to handle sending all the possible errors .

Creatoon commented 1 year ago

@durgesh077 we are not writing any json file to the disk at the time of package creation, it happens in the deploying phase.

Also, anything will only be written to the disk once callback fired by busboy runs successfully.

If there will be any error all the data will be flushed out as it's in the memory.