This commit is contained in:
Bryce
2025-11-09 19:41:37 -08:00
parent 5a61777128
commit 903ffbbf42
5 changed files with 510 additions and 252 deletions

27
app.py
View File

@@ -125,7 +125,8 @@ def convert_to_pacific_time(date_str):
def fetch_all_projects():
"""Fetch all projects for a user and store them in Firestore"""
# This function is now only used by sync.py
# In production, this should be removed or marked as deprecated
print("Fetching projects....")
# Initialize Filevine client
client = FilevineClient()
@@ -138,19 +139,11 @@ def fetch_all_projects():
# Fetch details for each
detailed_rows = []
import worker_pool
detailed_rows = worker_pool.process_projects_parallel(projects, client, 9)
# Store the results in Firestore
projects_ref = db.collection("projects")
# Add new projects
for row in detailed_rows:
project_id = str(row.get("ProjectId"))
if project_id:
projects_ref.document(project_id).set(row)
print(f"Stored {len(detailed_rows)} projects in Firestore")
return detailed_rows
# This functionality has been moved to sync.py
# The worker_pool module has been removed
# This function is kept for backward compatibility but should not be used in production
print("[DEPRECATED] fetch_all_projects() is deprecated. Use sync.py instead.")
return []
@app.route("/")
def index():
@@ -212,12 +205,6 @@ def welcome():
# --- Filevine API ---
# Filevine client is now in filevine_client.py
@app.route("/dashboard")
@app.route("/dashboard/<int:page>")
@login_required