No need to check, just put the upload code in post_publish.rb and the recording scripts will execute this automatically when it is published.
Also, if you really need to know when the recording states change for a recording, set a webhook with bbb-webhooks, and every event will be sent to your application real time.
Regards,
Stephen