public void Run() { try { _logger.Info("WebRole.Run called"); Container.Resolve <ISyncService>().SyncForever(() => Constants.SyncInterval); } catch (Exception e) { _logger.Error("Uncaught exception in Run()", e); DiagnosticsHelper.WriteExceptionToBlobStorage(e); throw; } }
public void OnStart() { try { Configure(); var syncService = Container.Resolve <ISyncService>(); var webDeployService = Container.Resolve <IWebDeployService>(); Container.Resolve <IBackgroundWorkerService>(); // This registers event handlers after activation - resolving is enough syncService.SyncOnce(); webDeployService.Start(); } catch (Exception e) { _logger.Error("Uncaught exception in OnStart()", e); DiagnosticsHelper.WriteExceptionToBlobStorage(e); throw; } }