Webber
Webber
CDCloudflare Developers
Created by Webber on 7/8/2023 in #workers-help
How does worker max time work precisely?
Thank you very much!
13 replies
CDCloudflare Developers
Created by Webber on 7/8/2023 in #workers-help
How does worker max time work precisely?
I see
13 replies
CDCloudflare Developers
Created by Webber on 7/8/2023 in #workers-help
How does worker max time work precisely?
Meaning I should define my application routes (as well as any possible class instances) for every request - inside the fetch implementation?
13 replies
CDCloudflare Developers
Created by Webber on 7/8/2023 in #workers-help
How does worker max time work precisely?
Ah right. I forgot. All the more reason to already have the env before fetch is called, I'd say - right?
13 replies
CDCloudflare Developers
Created by Webber on 7/8/2023 in #workers-help
How does worker max time work precisely?
One last follow-up question if you don't mind. In that case, why is env passed as part of the async fetch call? I realise that after an hour they might be a bit outdated, but is it also possible to load env manually (e.g. periodically)? Consider some code like:
app = expressLike(/* some elaborate application that needs `env` */)

export default {
async fetch(req, env, ctx) {
app.handle(req)
}
}
app = expressLike(/* some elaborate application that needs `env` */)

export default {
async fetch(req, env, ctx) {
app.handle(req)
}
}
Is there some good practice in handling env variables in cases like this?
13 replies