#Actor Standby Question

1 messages · Page 1 of 1 (latest)

versed sky
#

How to know if current Actor have StandBy mode enabled.
So.. the Actor can decide whether it should activate HTTP server or run normal Codes.
Is there any API or ENV variable that I could use ?

Thank You!

rapid patio
#

Hi @versed sky

You can check these two articles about the StandBy mode
https://docs.apify.com/platform/actors/running/standby
https://docs.apify.com/platform/actors/development/programming-interface/standby

But in short you should see the option in settings if its enabled/disabled or by checking the standby navigation option next to the input.

Use the Actor as a real-time API server.

Use the Actor as a real-time API server.

versed sky
#

Thanks for @rapid patio . What I mean is, how to know programmatically.

rapid patio
versed sky
#

I have tried Actor.config.get('standbyPort') it always return a port number, even though StandBy mode is DISABLED. I have tried the example codes and enable standby mode. When I run the Actor via web console, it always run the HTTP server. I want the Actor not to run HTTP server when it run from web console or normal API.

rapid patio
#

I've checked with the team and
you can have a look at the APIFY_META_ORIGIN environment variable, and if it equals "STANDBY", it means that the run is started via Standby mode. If the run is started via the Console or API (or any other way), it will contain something else.
The standbyPort configuration option will always be present there, even if Standby mode is disabled.