Fix for http error by using attempt on the wait period.

Signed-off-by: Graham Chiu <compkarori@gmail.com>