changed to db for fit streams
This commit is contained in:
29
FitnessSync/backend/backfill_streams.py
Normal file
29
FitnessSync/backend/backfill_streams.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
# Add backend to path
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
from src.services.postgresql_manager import PostgreSQLManager
|
||||
from src.services.sync_app import SyncApp
|
||||
from src.services.garmin.client import GarminClient
|
||||
from src.utils.config import config
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def main():
|
||||
logger.info("Starting stream backfill...")
|
||||
db_manager = PostgreSQLManager(config.DATABASE_URL)
|
||||
|
||||
with db_manager.get_db_session() as session:
|
||||
# Client not needed for local reparse but SyncApp requires it
|
||||
client = GarminClient()
|
||||
app = SyncApp(session, client)
|
||||
|
||||
result = app.activity_sync.reparse_local_files()
|
||||
logger.info(f"Backfill complete: {result}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user