mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 11:46:07 +00:00
feat: Initial backend setup for Music Analyser
- Created FastAPI backend structure. - Implemented Spotify Recently Played ingestion logic. - Set up SQLite database with SQLAlchemy models. - Added AI Service using Google Gemini. - Created helper scripts for auth and background worker. - Added Dockerfile and GitHub Actions workflow.
This commit is contained in:
22
backend/run_worker.py
Normal file
22
backend/run_worker.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import asyncio
|
||||
import sys
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# Add the current directory to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from app.database import Base, engine
|
||||
from app.ingest import run_worker
|
||||
|
||||
# Ensure tables exist
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Starting Background Worker...")
|
||||
try:
|
||||
asyncio.run(run_worker())
|
||||
except KeyboardInterrupt:
|
||||
print("Worker stopped.")
|
||||
Reference in New Issue
Block a user