close database connection in feed background thread