Anvil app server - modify 30 second timeout

If I load the anvil app server in my GCP Compute Engine and clone/run my app on my own server, can I control/modify the 30 second server code timeout so that my processes can run longer?

You could try background task

Thanks Tony - I’m familiar with server background tasks. If in my client code/form I have a file load component and my user selects a large file, I call a server task which would hand that file object to a background task.

The problem is, if that is a large file and it takes longer than 30 seconds - the design fails.

You could use a client writeable view to load the file. I described that on a thread here:

2 Likes

Thanks Owen - I have not tested this, I will. Did you do this in the context of my original question, i.e. on your own instance of the open-source Anvil Server?

I’m still wondering if installing and running the open-source Anvil Server allows for configuration of the server code timeout interval.

No, it wasn’t on my own app server, it was on the hosted server. No reason why it wouldn’t work the same , though.

Looking through the source, it looks like it pulls the timeout value from an environment variable with a 30 second default:

TIMEOUT = int(os.environ.get("DOWNLINK_WORKER_TIMEOUT", "30"))

So yes, set that environment variable to something else and it should adjust the timeout. You’ll probably need to restart the server for it to take effect.

4 Likes

Perfect… I’ll test that, thanks

Closing the loop - writeable views solved my problem entirely, thanks

1 Like

Hi @dconnell,

Congratulation, you find the solution. Does it work? Thanks so much

Hi Tony,

I am not certain if this parameter works/solves my problem, I’ve yet to test it, I solved my problem using writeable views.

I have successfully installed the Anvil app server and cloned my app, I’m just waiting to configure my firewall to see if I can hit my app from the outside, etc.

Would you mind share a link to more info about writeable view? Thanks

Owen Campbell’s response above includes a link to the relevant portions of the Anvil Docs.

get it, really appreciate that