feat: 新增 Job Worker 系統與 API 文檔全面更新
This commit is contained in:
@@ -8,14 +8,24 @@ import sys
|
||||
import json
|
||||
import argparse
|
||||
import os
|
||||
import signal
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from redis_publisher import RedisPublisher
|
||||
|
||||
|
||||
def signal_handler(signum, frame):
|
||||
print(f"OCR: Received signal {signum}, exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def process_ocr(video_path: str, output_path: str, uuid: str = ""):
|
||||
"""Process video for OCR using EasyOCR"""
|
||||
|
||||
# Set up signal handlers
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
publisher = RedisPublisher(uuid) if uuid else None
|
||||
if publisher:
|
||||
publisher.info("ocr", "OCR_START")
|
||||
|
||||
Reference in New Issue
Block a user