From d07d1ebeb683759f73981a71ce6219877c23ffe2 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 3 Dec 2024 13:00:33 +0100 Subject: [PATCH] reduce threshold --- app/cron_pocketbase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/cron_pocketbase.py b/app/cron_pocketbase.py index cf1f49f..0f29963 100644 --- a/app/cron_pocketbase.py +++ b/app/cron_pocketbase.py @@ -38,7 +38,8 @@ admin_data = pb.collection('_superusers').auth_with_password(pb_admin_email, pb_ now = datetime.now() -one_month_ago = now - timedelta(days=30) +#one_month_ago = now - timedelta(days=30) +time_threshold = now - timedelta(days=7) def send_email(recipient): @@ -96,7 +97,7 @@ async def update_free_trial(): for item in data: created_date = item.created # Check if the created date is more than N days ago - if created_date < one_month_ago: + if created_date < time_threshold: # Update the user record pb.collection("users").update(item.id, { "tier": 'Free',