Fix async loop

FeroxRev [2016-07-21 07:17:03]
Fix async loop
Filename
PokemonGo.RocketAPI.Logic/Logic.cs
diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs
index 7024077..464e593 100644
--- a/PokemonGo.RocketAPI.Logic/Logic.cs
+++ b/PokemonGo.RocketAPI.Logic/Logic.cs
@@ -40,9 +40,7 @@ namespace PokemonGo.RocketAPI.Logic
                         await client.DoGoogleLogin();

                     await client.SetServer();
-
-
-                    RepeatAction(10, async () => await ExecuteFarmingPokestopsAndPokemons(client));
+                    await RepeatAction(10, async () => await ExecuteFarmingPokestopsAndPokemons(client));
                     await TransferDuplicatePokemon();

                     /*
@@ -64,10 +62,10 @@ namespace PokemonGo.RocketAPI.Logic
             }
         }

-        public void RepeatAction(int repeat, Action action)
+        public async Task RepeatAction(int repeat, Func<Task> action)
         {
             for (int i = 0; i < repeat; i++)
-                action();
+                await action();
         }

         private async Task ExecuteFarmingPokestopsAndPokemons(Client client)
You may download the files in Public Git.