Skip to content

Commit 7a1a530

Browse files
Jiaxi LiJiaxi Li
Jiaxi Li
authored and
Jiaxi Li
committed
update abstractqueue to fit the db schame change
1 parent 336859b commit 7a1a530

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/agent/tasks/AbstractTask.py

+13
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ def get_video(self, video_id):
117117
self.logger.error("Failed to fetch videoId=%s: %s" % (video_id, e))
118118
return None
119119

120+
def get_scene(self, video_id):
121+
# fetch scene data by id
122+
try:
123+
resp = requests.get(url='%s/api/Task/GetSceneData?videoId=%s' % (self.target_host, video_id),
124+
headers={'Authorization': 'Bearer %s' % self.jwt})
125+
# self.logger.debug(' [%s] SceneDetection fetched video: %s' % (video_id, resp.text))
126+
resp.raise_for_status()
127+
scene = resp.json()
128+
return scene
129+
except (requests.exceptions.RequestException, requests.exceptions.HTTPError) as e:
130+
self.logger.error("Failed to fetch videoId=%s: %s" % (video_id, e))
131+
return None
132+
120133
def update_jwt(self):
121134
# update jwt token
122135
try:

0 commit comments

Comments
 (0)