Skip to content

v1.6.0(beta) - add automated daily cron job for inactive user deletion

Choose a tag to compare

@daviddprtma daviddprtma released this 12 Jul 11:56
· 56 commits to main since this release
0672db2

Description of Changes

Implemented an automated backend cron job to optimize database storage by cleaning up inactive user accounts. by @dhruv-gupta-dev in #231

-Database: Created a Supabase migration script to safely add the last_active_at timestamp column to public.profiles. by @dhruv-gupta-dev in #231

-Middleware: Updated requireAuth in backend/src/middleware/auth.js to asynchronously update user activity timestamps without blocking requests. by @dhruv-gupta-dev in #231

-Cron Service: Built a daily background task (node-cron) in backend/src/services/cron.js that loops through and deletes users inactive for 30, 60, or 365 days using supabase.auth.admin.deleteUser(). by @dhruv-gupta-dev in #231

You can support AgroDex project for Indonesian agriculture in here https://github.com/sponsors/daviddprtma