static void Main(string[] args) { TypeTree nodeTypeTree = TypeTree.LoadFromJson("arm-node-type-tree.json"); #if !DEBUG if (switchIndex(args, "v") >= 0) #endif { Trace.Listeners.Clear(); Trace.Listeners.Add(new ConsoleTraceListener()); } var token = readParameter(args, "t"); #if !DEBUG if (string.IsNullOrEmpty(token)) { Console.WriteLine("GitHub authentication token is required (pass it in using -t switch)."); return; } #else token = ConfigurationManager.AppSettings["GitHubToken"]; #endif var crawlerManagers = new CrawlerManager[] { new AzureQuickstartCrawlerManager(token) }; var loop = Parallel.ForEach <CrawlerManager>(crawlerManagers, (manager) => { var graphs = manager.CrawlAsync().Result; var graphDB = new GraphDBClient.CosmosDBClient(ConfigurationManager.AppSettings["CosmosDBEndpoint"], ConfigurationManager.AppSettings["CosmosDBAuthKey"]); graphDB.Connect().WriteGraphs(ConfigurationManager.AppSettings["GraphDatabase"], ConfigurationManager.AppSettings["GraphCollection"], graphs); }); while (!loop.IsCompleted) { Thread.Sleep(1000); } Console.WriteLine("Done!"); }