wait for db connection before crawling