|
@@ -77,6 +77,8 @@ def title_generate_main():
|
|
|
|
|
|
|
|
|
title = title_generate(video_id=video_id, video_path=video_path)
|
|
|
+ if title[0] in ['"', "'"] and title[-1] in ['"', "'"]:
|
|
|
+ title = title[1:-1]
|
|
|
log_.info({'titleGenerate': {'videoId': video_id, 'title': title}})
|
|
|
|
|
|
except ConnectionResetError:
|
|
@@ -134,7 +136,7 @@ def title_generate_main():
|
|
|
|
|
|
|
|
|
|
|
|
- log_.info(f"receipt_handle_list: {receipt_handle_list}")
|
|
|
+
|
|
|
consumer.ack_message(receipt_handle_list)
|
|
|
log_.info({
|
|
|
'ackMessage': {
|
|
@@ -142,29 +144,36 @@ def title_generate_main():
|
|
|
'receiptHandleList': receipt_handle_list
|
|
|
}
|
|
|
})
|
|
|
- except MQExceptionBase as consume_e:
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ except Exception as consume_e:
|
|
|
log_.error({
|
|
|
'errorType': 'consume',
|
|
|
'status': 'fail',
|
|
|
'exception': consume_e,
|
|
|
'traceback': traceback.format_exc()
|
|
|
})
|
|
|
-
|
|
|
- if consume_e.type == "MessageNotExist":
|
|
|
- print(("No new message! RequestId: %s" % consume_e.req_id))
|
|
|
- continue
|
|
|
-
|
|
|
- elif consume_e.sub_errors:
|
|
|
- for sub_error in consume_e.sub_errors:
|
|
|
- print(("\tErrorHandle:%s,ErrorCode:%s,ErrorMsg:%s" % \
|
|
|
- (sub_error["ReceiptHandle"], sub_error["ErrorCode"], sub_error["ErrorMessage"])))
|
|
|
-
|
|
|
- log_.error("Consume Message Fail! Exception:%s\n" % consume_e)
|
|
|
- time.sleep(2)
|
|
|
- continue
|
|
|
-
|
|
|
- except Exception as e:
|
|
|
log_.error("Consume Message Fail! Exception:%s\n" % e)
|
|
|
+ time.sleep(30)
|
|
|
continue
|
|
|
|
|
|
|