private static void InitializeProjections(NuclearStorage documentStore, IEnumerable <ProjectionInfo> generatedInfos, List <ProjectionInfo> readyForUse, List <ProjectionInfo> needRebuild) { needRebuild.ForEach(p => p.Initialize(documentStore)); // for loaded projection initialize document store and projection // if there's a problem - switch to using correlating generated projection for (var i = 0; i < readyForUse.Count; i++) { var loadedProjectionInfo = readyForUse[i]; var relatedGeneratedProjection = generatedInfos.First(pi => pi == loadedProjectionInfo); try { loadedProjectionInfo.Initialize(documentStore); } catch (Exception x) { NetcoLogger.GetLogger(typeof(PartitionedProjectionsInfo)).Log().Error(x, "Error encountered while initializing projection info: {0}", loadedProjectionInfo.ProjectionName); // switch to using generated projection info for this projection to force rebuild readyForUse.RemoveAt(i); i--; relatedGeneratedProjection.Initialize(documentStore); needRebuild.Add(relatedGeneratedProjection); } } }
public AzureAtomicReader(CloudBlobClient storageClient, IDocumentStrategy strategy) { this._strategy = strategy; var folder = strategy.GetEntityBucket <TEntity>(); this._containerDirectory = storageClient.GetBlobDirectory(folder); this._logger = NetcoLogger.GetLogger(this.GetType()); this._ap = ActionPolicyAsync.From((exception => { var storageException = exception as StorageException; if (storageException == null) { return(false); } switch (storageException.RequestInformation.HttpStatusCode) { case ( int )HttpStatusCode.InternalServerError: case ( int )HttpStatusCode.ServiceUnavailable: return(true); default: return(false); } })).Retry(200, (ex, i) => { this._logger.Log().Trace(ex, "Retrying Azure API GET call: {0}/200", i); var secondsDelay = 0.2 + 0.1 * _random.Next(-1, 1); // randomize wait time Task.Delay(TimeSpan.FromSeconds(secondsDelay)).Wait(); }); }
private static void Main(string[] args) { NetcoLogger.LoggerFactory = new NLogLoggerFactory(); try { var actions = new ActionsFactory().CreateCommandsToExecute(); PrintActionsToExecute(actions); ExecuteActionsWithConfirmation(actions); } catch (Exception exc) { NetcoLogger.GetLogger(typeof(Program)).Error(exc, "Global exception"); } Console.WriteLine("Press ENTER to exit"); Console.ReadLine(); }
public static bool TryReadFrame(Stream source, out StorageFrameDecoded result) { result = default(StorageFrameDecoded); try { result = ReadFrame(source); return(!result.IsEmpty); } catch (EndOfStreamException) { // we are done return(false); } catch (Exception ex) { NetcoLogger.GetLogger(typeof(StorageFramesEvil)).Error(ex, "ReadFrame encountered error"); // Auto-clean? return(false); } }
public static ILogger Log() { return(NetcoLogger.GetLogger("QuickBooksOnlineLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("MivaLogger")); }
static BigCommerceLogger() { Log = NetcoLogger.GetLogger("BigCommerceLogger"); }
public static ILogger Log() { return(NetcoLogger.GetLogger("SquareLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("ChannelAdvisorLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("BigCommerceLogger")); }
static LightspeedLogger() { Log = NetcoLogger.GetLogger("LightspeedLogger"); }
public static ILogger Log() { return(NetcoLogger.GetLogger("SkubanaLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("NetSuiteLogger")); }
static ShopVisibleLogger() { Log = NetcoLogger.GetLogger("ShopVisibleLogger"); }
public static ILogger Log() { return(NetcoLogger.GetLogger("NewEggLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("LogicBrokerLogger")); }
static ShipStationLogger() { Log = NetcoLogger.GetLogger("ShipStationLogger"); }
public static ILogger Log() { return(NetcoLogger.GetLogger("SellbriteLogger")); }
public static ILogger Log() { return(NetcoLogger.GetLogger("TrueShipLogger")); }
static ReverbLogger() { Log = NetcoLogger.GetLogger("ReverbLogger"); }