Cron worker to generate stats