private static void WaitTillTrue(Func<bool> func) { for(int i = 0; i < 40; i++) { try { if (func()) return; } catch { } AWSSDKUtils.Sleep(1000); } }