Closed hariom-qure closed 3 months ago
Is the slow function required for the module/server to operate correctly?
If so, I don't know if there's a way around that. Do it in Provision...
If it's not required (then why even do it?), then maybe start a goroutine and do some basic synchronization for when it's done... does that make sense?
We either block the loading of the server or we don't -- ideally, avoid slow tasks at config load.
great, thanks a lot for the quick reply, I do want to block the server before the extension is done, so should be fine
Yeah, sounds good. Just note your experience as a sysadmin will be degraded with slow config loads.
I want to run some time taking code before caddy starts serving requests (a one time setup essentially for the module, if its configured) What is the correct method to do it in? At first I thought it would be in
Provision
but its explicitly written that we should not do time taking operations there ref: https://caddyserver.com/docs/extending-caddy#provisioningThanks!