Limit scheduler to production or have per-target on/off

I’m noticing that when developing, my dev environment is firing the server-side scheduler (NodeJS) the same as my prod environment so I’m ending up with double events. Could it either be limited to production only or can we have a per-target switch to enable/disable it?

Could you not just toggle App Connect to off when developing Ben? Surely that’s the same thing you are asking for, or am I wrong?

Cheers Dave,
That only turns off the client-side App Connect - the Docker engine keeps running to allow you to preview pages via QR code etc.

Just kill Docker service then when you Deploy it will bring it back up, as you probably know. Don’t use the QR code myself. I’ll refrain from further comment sir. Hope you get what you need sorted.

:slight_smile:

Appreciate the help. As soon as you load the project, the Docker service is initiated and starts the scheduled actions. I have to remember to kill it but that makes testing on local impossible unless it is run again and then stopped at the end of test. :crossed_fingers: @george and the team can add something quite quickly

You could add an if condition as first step in the action that only runs if environment is production.

1 Like

Thanks. Is there a way to do this in the UI or is it a manual process to set ENV? (I presume this would be achieved using $_ENV variables)

Yes. Using $_ENV.NODE_ENV

How do you set the value per target - sorry never used $_ENV before…

If you are using docker deployment you set the target as dev, staging or prod. If you are using some PaaS the default is usually prod but you can set them somewhere.

It’s Docker - targets are nominated dev and prod.

BOOM! It’s easy - I didn’t realise that the setup had already set the values. Cheers! :beer:

1 Like