How to pause recording while connection is down?

Hello developers!

we all know that we can record after finished streaming
i want to streaming my camera using RTMPS in Cloudflare Stream, but when my camera connection is lost i don’t want to stop recording it so when my connection camera is up again the recording is resume again and stop when i am stop streaming

how can i create those system? because there are no result in any search engine

i solved it using timeoutSeconds parameter in recording

"recording": {
    "mode": "automatic",
    "requireSignedURLs": false,
    "timeoutSeconds": 500