Prevent EOFError while updating stats with cron jobs