https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • h

    HardAtWork

    04/13/2023, 10:04 AM
    So each request may be processed by a new Worker
  • g

    greyireland

    04/13/2023, 10:06 AM
    Is it possible to trigger a request when deploying?
  • h

    HardAtWork

    04/13/2023, 10:06 AM
    I guess? But it would only run in that one Worker
  • h

    HardAtWork

    04/13/2023, 10:07 AM
    Workers aren't containers that stay on until they are shut down
  • h

    HardAtWork

    04/13/2023, 10:07 AM
    They only exist as long as they are needed, and then they are scaled to zero. And there is no way to directly interact with a specific one
  • g

    greyireland

    04/13/2023, 10:09 AM
    When deploying, did you just copy the code to the server? Is it possible to also execute some default function or initial function or something?
  • h

    HardAtWork

    04/13/2023, 10:10 AM
    What are you trying to do? I'm not following.
  • s

    sirhype

    04/13/2023, 10:10 AM
    Can't seem to do it this way with custom staging env variables (like using a staging.env file) 😦
  • k

    kian

    04/13/2023, 10:11 AM
    .env
    files aren't considered by Workers (Wrangler) at all
  • s

    sirhype

    04/13/2023, 10:11 AM
    Ah, it's a Miniflare thing?
  • s

    sirhype

    04/13/2023, 10:11 AM
    .dev.vars is a Wrangler thing right?
  • h

    HardAtWork

    04/13/2023, 10:12 AM
    Yup
  • g

    greyireland

    04/13/2023, 10:12 AM
    I want to visit a website once from all over the world and see the latency in each~
  • h

    HardAtWork

    04/13/2023, 10:13 AM
    You might be able to build something like that with Durable Objects(which you can only lock to regions, and not individual datacenters), or hit a Worker with a ping from every Datacenter, but that requires the Enterprise plan.
  • s

    sirhype

    04/13/2023, 10:17 AM
    wait i'm dumb please ignore me
  • s

    sirhype

    04/13/2023, 10:17 AM
    I can just make a new env, it'll have its own secrets in wrangler. Then I use .dev.vars for that environment locally. and prod will use the prod secrets
  • s

    sirhype

    04/13/2023, 10:18 AM
    I was overthinking it 😄
  • g

    greyireland

    04/13/2023, 10:21 AM
    Yes, I want to ping the address of a certain website in each data center, and then count the request delay. Can cloudflare's service achieve this? Is there a reference document?
  • h

    HardAtWork

    04/13/2023, 10:22 AM
    Yes, but this requires Enterprise to achieve, which costs a few thousand $ a month.
  • h

    HardAtWork

    04/13/2023, 10:22 AM
    This being a Load Balancer Health Check
  • g

    greyireland

    04/13/2023, 10:25 AM
    Yes, the principle is similar to that of loadbalancer. Is there any ready-made service or document to check?
  • h

    HardAtWork

    04/13/2023, 10:28 AM
    https://developers.cloudflare.com/load-balancing/understand-basics/monitors
  • b

    bret_pat

    04/13/2023, 9:51 PM
    Can a bundled worker know it's CPU usage? I have a task that consists of a long series of API calls and wanted to know when it would be time to kick-off the next bundled service worker.
  • h

    HardAtWork

    04/13/2023, 9:55 PM
    It cannot
  • s

    Sanju

    04/14/2023, 4:31 AM
    Hi everyone, how to use workers cron to trigger certain endpoint?. For example - www.example.com/api/trigger. I want to trigger only this endpoint and how should i achieve it?
  • c

    chientrm

    04/14/2023, 4:42 AM
    use
    fetch
    ?
  • s

    Sanju

    04/14/2023, 4:43 AM
    I'm using Hono js
  • s

    Sanju

    04/14/2023, 4:44 AM
    Can you elaborate more on this? @chientrm
  • c

    chientrm

    04/14/2023, 4:45 AM
    https://developers.cloudflare.com/workers/platform/triggers/cron-triggers/
  • c

    chientrm

    04/14/2023, 4:45 AM
    https://developers.cloudflare.com/workers/runtime-apis/fetch/
1...239223932394...2509Latest