sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
729 stars 142 forks source link

Timeout for converting from scanned TIFF files into single PDF #430

Open ceskyDJ opened 2 years ago

ceskyDJ commented 2 years ago

Hi, I scanned more pages (~30) and got into trouble similar to the one described in issue #414. Timeout in scanservjs alerted me about an error:

Type error: failed to fetch.

but after some time, file disappeared from /var/www/scanservjs/data/temp/ and I found valid complete PDF file in /var/www/scanservjs/data/output/. When I refresh the list in scanservjs, it shows the result, too.

We were discussing this some time ago. Today, I realized that it could be solved differently than using timeout and giving the timeout error alert to the user. What about checking the state of the ImageMagick process + using a big timeout for cases, it just ended on some error like starvation, etc?

Linked issues:

zjph602xtc commented 1 year ago

I met the exact same error. I waited for some time, refreshed the page, and then the file is there. I believe my raspberry pi is just too slow.

Maybe there will be a good solution, but I think you can just change the error to "Please wait for a while and refresh the page". Otherwise, the user thinks the scanning fails somehow and just starts to scan again.

daladim commented 1 year ago

Hi. I experienced the same issue, using a dockerized scanservjs on a Raspberry Pi.

From the frontend, the error is not very explicit : image

It is fine to have long processing issues, but as @zjph602xtc suggested, having a more explicit error message would be very neat! I thought my scans were failing, until I saw this issue. Now instead of just restarting the docker image thinking it failed, I just wait a bit, and I can now get my scanned jobs :)