yumauri / gotenberg-js-client

A simple JS/TS client for interacting with a Gotenberg API
MIT License
110 stars 9 forks source link

set delay #61

Closed PedroHenrique-F closed 10 months ago

PedroHenrique-F commented 12 months ago

` gotenberg('http://localhost:3000/forms/chromium'), convert, url, set({ waitDelay: 10000 }), request => { ( request.fields as unknown as { url: string; } ).url = request.fields.remoteURL; delete request.fields.remoteURL; return request; }, please, );

`

Why when adding the set({ waitDelay: 10000 }), it stops working?

yumauri commented 12 months ago

Hello! By the URL I assume you use Gotenberg version 7. Do you see any errors in Gotenberg? As far as I see in documentation — https://gotenberg.dev/docs/routes#wait-before-rendering — in version 7 this field has different format. Try this (maybe it will also require TypeScript soothing):

set({ waitDelay: '10s' }),
yumauri commented 12 months ago

In version 6 waitDelay is set in seconds, so 10000 is about 3 hours. I guess it is not what you expect. Maybe version 7 also accepts numbers, try also

set({ waitDelay: 10 }),
yumauri commented 11 months ago

@PedroHenrique-F did you fix an issue with my suggestions?

yumauri commented 10 months ago

I assume you've either fixed your issue, with or without my help, or moved on, maybe with another library. I'll close this issue, but feel free to reopen it if my suggestions didn't help.