separates syncing
This commit is contained in:
27
sync.py
Normal file
27
sync.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Sync script to fetch and store projects in Firestore
|
||||
This can be run manually from the command line to update the projects collection
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the current directory to the Python path so we can import app
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from app import fetch_all_projects
|
||||
|
||||
def main():
|
||||
"""Main function to fetch and sync projects"""
|
||||
print("Starting project sync...")
|
||||
try:
|
||||
# Fetch all projects and store them in Firestore
|
||||
projects = fetch_all_projects()
|
||||
print(f"Successfully synced {len(projects)} projects to Firestore")
|
||||
except Exception as e:
|
||||
print(f"Error during sync: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user