Improve the logic of waiting for CLDB service