1st_fix_login_issue
This commit is contained in:
26
celery_worker.py
Normal file
26
celery_worker.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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()
|
Reference in New Issue
Block a user