try a maximum of 3 times if total can't be retrieved

Signed-off-by: songyang <waoywssy@gmail.com>