How to know when deployment was successful and is reachable?

Is there a way to check/know after a wrangler pages deploy that the page and its functions are successfully deployed and reachable? I am already waiting for 5s after deploy before I check, but often that still leads to a HTML page instead of the Json that I expect from my function/worker.
4 Replies
kian
kian12mo ago
There isn't really anything you can do other than polling the deployment URL until you're served what you expect - Pages uses Workers under the hood and a successful deploy just means it has been accepted/uploaded, it still takes time to propagate.
Jan Piotrowski (janpio)
Is there a difference in "deployment speed"? For Workers I think I don't have the same problems... wrangler deploy seems to be much more instant than wrangler pages deploy
Chaika
Chaika12mo ago
I haven't measured them but Pages deploys are pretty quick, from when all of the assets are uploaded it's only a few seconds until its live. What exactly are you doing that depends on it being deployed? Most deployments should be pretty quick, but in extreme cases with deployment delay it could take hours for one to become live, and it has before
Jan Piotrowski (janpio)
I am testing Prisma ORM, if it works in different combinations on Cloudflare Workers and Pages - so I have quite a special use case. Many deployments with the only job to once successfully respond. I already added a 5s sleep for Cloudflare Pages, but the functions are still often not available when the tests then tries. The Workers don't even need the sleep.
Want results from more Discord servers?
Add your server