Simple exponential backoff code. Have to add a maximum delay setting, something like 5*5<300: 5s, multiply by 5 on each failure, but stop increasing once we hit 5m.