public void ConfigureHangfireBuilder(IGlobalConfiguration builder)
 {
     builder.UseMemoryStorage();
     //We always use memory storage because of incompatibilities with the latest postgres in 2.1
     //if (_Type == DatabaseType.Sqlite)
     //    builder.UseMemoryStorage(); //Sqlite provider does not support multiple workers
     //else if (_Type == DatabaseType.Postgres)
     //    builder.UsePostgreSqlStorage(_ConnectionString);
 }
        /// <summary>
        /// This method is called during the apply method
        /// </summary>
        protected override void ProviderSetup(IGlobalConfiguration hangfireConfiguration)
        {
            if (!Enabled)
            {
                return;
            }

            hangfireConfiguration.UseMemoryStorage();
            IsActive = true;
        }
Example #3
0
 public void ConfigureHangfireBuilder(IGlobalConfiguration builder)
 {
     if (_Type == DatabaseType.Sqlite)
     {
         builder.UseMemoryStorage();                 //Sql provider does not support multiple workers
     }
     else if (_Type == DatabaseType.Postgres)
     {
         builder.UsePostgreSqlStorage(_ConnectionString);
     }
 }
Example #4
0
        private static void ConfigureHangfire(IGlobalConfiguration config)
        {
            var settings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                Converters       =
                {
                    new StringEnumConverter(new CamelCaseNamingStrategy()),
                    JsonSubtypesConverterBuilder
                    .Of(typeof(CrawlRequestBase), "type")
                    .RegisterSubtype(typeof(HyperlinkCrawlRequest), CrawlRequestType.Hyperlink)
                    .SerializeDiscriminatorProperty()
                    .Build()
                }
            };

            JobHelper.SetSerializerSettings(settings);

            config.UseMemoryStorage(
                new MemoryStorageOptions
            {
                FetchNextJobTimeout = TimeSpan.FromMinutes(60)
            });
        }
 private void ConfigureHangfire(IGlobalConfiguration configuration)
 {
     configuration.UseMemoryStorage();
 }
        public static MemoryStorage UseMemoryStorage(this IGlobalConfiguration configuration)
        {
            var storageOptions = new MemoryStorageOptions();

            return(configuration.UseMemoryStorage(storageOptions));
        }
Example #7
0
 public void Configure(IGlobalConfiguration hangfireGlobalConfiguration)
 {
     hangfireGlobalConfiguration.UseMemoryStorage();
 }
 public void Configure(IGlobalConfiguration hangfireGlobalConfiguration)
 {
     hangfireGlobalConfiguration.UseMemoryStorage();
 }