26 lines
463 B
Python
26 lines
463 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Celery Worker 啟動腳本
|
|
|
|
Author: PANJIT IT Team
|
|
Created: 2024-01-28
|
|
Modified: 2024-01-28
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# 添加專案根目錄到 Python 路徑
|
|
project_root = Path(__file__).parent
|
|
sys.path.insert(0, str(project_root))
|
|
|
|
from app import create_app
|
|
|
|
# 建立應用並取得 Celery 實例
|
|
app = create_app()
|
|
celery = app.celery
|
|
|
|
if __name__ == '__main__':
|
|
celery.start() |