You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds documentation for readiness probe in Actor standby along
with code examples that show example handling of the readiness requests.
---------
Co-authored-by: Michał Olender <[email protected]>
Copy file name to clipboardExpand all lines: sources/platform/actors/development/programming_interface/actor_standby.md
+66
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,72 @@ async def main() -> None:
72
72
Please make sure to describe your Actors, their endpoints, and the schema for their
73
73
inputs and outputs in your README.
74
74
75
+
### Readiness probe
76
+
77
+
Before Actor standby runs are ready to serve requests, the Apify platform checks the web server's readiness using a readiness probe.
78
+
The platform sends a GET request to the path `/` with a header `x-apify-container-server-readiness-probe`. If the header is present in the request, you can perform an early return with a simple response to prevent wasting resources.
79
+
80
+
:::note Return a response
81
+
82
+
You must return a response; otherwise, the Actor run will never be marked as ready and won't process requests.
83
+
84
+
:::
85
+
86
+
87
+
See example code below that distinguishes between "normal" and "readiness probe" requests.
0 commit comments