Retry get_flags after 5 seconds if network error