Skip to content

Commit 16af534

Browse files
velovixBestDriverCN
andcommitted
Add check_analyzing function
Co-authored-by: Zhao Wang <wzh31262@gmail.com>
1 parent 7ad0d2d commit 16af534

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

brainframe/api/stubs/analysis.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ def stop_analyzing(self, stream_id,
3131
req = f"/api/streams/{stream_id}/analyze"
3232
resp = self._put_json(req, timeout, 'false')
3333
return resp
34+
35+
def check_analyzing(self, stream_id,
36+
timeout=DEFAULT_TIMEOUT) -> bool:
37+
"""Check if this stream is being analyzed
38+
39+
:param stream_id: The ID of the stream to check
40+
:param timeout: The timeout to use for this request
41+
:return: True or False if the stream is being analyzed
42+
"""
43+
req = f"/api/streams/{stream_id}/analyze"
44+
resp, _ = self._get_json(req, timeout)
45+
return resp
46+

0 commit comments

Comments
 (0)