Skip to content

Commit e27db71

Browse files
nikolay-eclaude
andcommitted
Change sync from 30 to 28 days (4 weeks exactly)
- Update button label to "Last 28 Days" - Change sync function default from 30 to 28 days - Update initial sync on login to use 28 days - This provides exactly 4 weeks of data for better weekly analysis 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c5fbe87 commit e27db71

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def get_settings_layout():
689689
html.Div(
690690
[
691691
html.Button(
692-
"🏃 Sync Garmin Data (Last 30 Days)",
692+
"🏃 Sync Garmin Data (Last 28 Days)",
693693
id="sync-garmin-btn",
694694
n_clicks=0,
695695
style={
@@ -1226,7 +1226,7 @@ def save_personal_settings(
12261226

12271227

12281228
# Background sync functions
1229-
def background_garmin_sync(user_id: int, days: int = 30):
1229+
def background_garmin_sync(user_id: int, days: int = 28):
12301230
"""Background function for Garmin data sync."""
12311231
with get_user_sync_lock(user_id):
12321232
try:
@@ -1280,9 +1280,9 @@ def initial_data_sync(user_id: int):
12801280

12811281
if creds and creds.garmin_email:
12821282
logger.info(
1283-
f"Syncing last 30 days of Garmin data for user {user_id}"
1283+
f"Syncing last 28 days of Garmin data for user {user_id}"
12841284
)
1285-
background_garmin_sync(user_id, days=30)
1285+
background_garmin_sync(user_id, days=28)
12861286

12871287
# Then sync all historical data in background
12881288
logger.info(
@@ -1383,7 +1383,7 @@ def sync_data(garmin_clicks, hevy_clicks):
13831383
# Run the sync function in a background thread
13841384
thread = threading.Thread(
13851385
target=background_garmin_sync,
1386-
args=(current_user.id, 30),
1386+
args=(current_user.id, 28),
13871387
daemon=True, # Thread will not prevent app shutdown
13881388
)
13891389
thread.start() # This returns immediately

pull_garmin_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def extract_steps_data_for_range(
370370
return []
371371

372372

373-
def sync_garmin_data(user_id: int, days: int = 60) -> dict:
373+
def sync_garmin_data(user_id: int, days: int = 28) -> dict:
374374
"""
375375
Sync Garmin data for a specific user for the specified number of days.
376376
Returns a summary of the sync operation.

0 commit comments

Comments
 (0)