Open mtuchi opened 7 months ago
Took a quick look at this with some spare time this afternoon.
It's actually quite a hard one.
The CLI uses yargs
to default the value of timeout
to 5 minutes.
When we load the workflow, we say "If the CLI specified an option as an argument (ie --timeout 100
, use that value. Otherwise, use options from the plan". And to know the user arguments, we look at the yargs
options.
But if yargs defaulted an option, it'll have a value and so override the plan value. We have no way of knowing right now whether a value is a default, or was explicitly set by the user.
The correct behaviour here is: prefer explicit CLI inputs to options on the plan.
The solutions I see are:
User story
In some cases i want my workflow to run longer the default timeout of
5minute ~ 300000ms
.Details
Using
@openfn/cli v1.0.0
theoptions.timeout
is not working, unless you specify the-t --timeout
option when running your workflow.Implementation notes
See sample workflow below 👇🏽 ,
If you run the workflow
openfn worfklow.json -m -o tmp/output.json
, The workflow will run successful but Ideally the workflow above should throw an error saying[R/T] ✘ Error: Timeout expired (300ms)
. But it doesn't fail unless you specify the timeout when running the workflow. Eg:openfn worfklow.json -m -o tmp/output.json -t 300
.