public override void Run() { // This is a sample worker implementation. Replace with your logic. Trace.WriteLine("WorkerRole entry point called", "Information"); while (true) { var importer = new Importer(ServiceLocator.GetInstance<ICommandBus>(), ServiceLocator.GetInstance<IStockPhotoDao>(), new Clock()); importer.Url = "http://www.deviantart.com/resources/stockart/model/?order=14"; //Popular 1 week importer.Start(); Thread.Sleep(1000 * 3600); } }
static void Main(string[] args) { Initialize(); var importer = new Importer(ServiceLocator.GetInstance<ICommandBus>(), ServiceLocator.GetInstance<IStockPhotoDao>(), new Clock()); OptionSet p = new OptionSet() .Add("u=", url => importer.Url = url ); try { p.Parse(args); } catch (OptionException ex) { Console.WriteLine(ex.Message); } if (importer.Url == null) { throw new InvalidOperationException(); } importer.Start(); }