Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "andmattia"

Small Update.

After read (another time) documentation I set Job

public override void PreInitialize()
    {
        Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
    }

[http://www.aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers#disabling-job-execution])

So now I've only service registered on HF. I've re enable HF on startup & dashboard and I can see the HF dashboard my job work fine. At the moment Notification not work fine because I don't see any NotificationDistributionJob

I try to move Hangfire(HF in rest of post) to service because I think in a Cluser eviroment it's more stable and scalable but I find some issue.

The step that I do is: disable on web module the HF

//Configuration.BackgroundJobs.UseHangfire(configuration =>
 //           {
  //              configuration.GlobalConfiguration.UseSqlServerStorage(queueName);
   //         });

After that in web proj I have a problem on Startup.cs beacuse at

app.UseHangfireDashboard("/hangfire", new DashboardOptions
            {
                Authorization = new[] { new    AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
            });

HangFire is not enable

My service is composed by (I share my code)

[DependsOn(typeof(AbpHangfireModule))]
    public class AbpHangFireService : AbpModule
    {
        public override void PreInitialize()
        {
            Database.SetInitializer<clayDbContext>(null);

            var queueName = "Default";

            Configuration.BackgroundJobs.UseHangfire(configuration =>
            {
                SqlServerStorageExtensions.UseSqlServerStorage(
                    (IGlobalConfiguration) configuration.GlobalConfiguration, queueName);
            });

        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }

and in service class

private readonly AbpBootstrapper bootstrapper;
        public Service1()
        {
            InitializeComponent();
            bootstrapper = AbpBootstrapper.Create<AbpHangFireService>();
            
                bootstrapper.IocManager.IocContainer
                    .AddFacility<LoggingFacility>(f => f.UseAbpLog4Net()
                        .WithConfig("log4net.config")
                    );

        }

        protected override void OnStart(string[] args)
        {

            bootstrapper.Initialize();
        }

        protected override void OnStop()
        {
            bootstrapper.Dispose();
        }

So my service start en log on txt file but if i dsable in web app I see only server on service if I re-enable it I see 2 sever app&service also if i disable in web app I cann't open dashboard is it possibile to bind web app to HF service. and If backgorundjob start on my service where service search dll (like core) in service bin or app bin?

I think probably you need to pass token to your method

can you share the excption?

Hi try to delete/reste a user setting await SettingManager.ChangeSettingForUserAsync(userIdentifier, "ipAll", "*");

"*" is the deafault value for tenat but if I do that i create a * for user not remove. I need to set to equal value for tentat?

Hi

I try to create a class T where I need to use a type T

public class ExcelExporter<T> : EpPlusExcelExporterBase, ITransientDependency
{
...
}

 public abstract class EpPlusExcelExporterBase
    {
        private ILocalizationSource _localizationSource;
        public IAppFolders AppFolders { get; set; }
        public ILocalizationManager LocalizationManager { get; set; }
        ...
}

 public class CustomerExcelExporter : ITransientDependency, ICustomerExcelExporter
    {
        private ILocalizationSource _localizationSource;
        public IAppFolders AppFolders { get; set; }
        public ILocalizationManager LocalizationManager { get; set; }
        public CustomerExcelExporter()
        {
            
        }
...
}

If I try to access to IAppFolder in base class it's empty I need to fill "manualy" in this way

var a = new ExcelExporter<Customer>(proj.LocalizationSourceName,
                appFolders:this.AppFolders,localizationManager:this.LocalizationManager)
            {
                OutputFileName = "Excel",
                OutputFileExtension = "xlsx",
                WorkSheetName = "Customer"
            };

It's work but I think i miss something or something is wrong is it correct?

I found a solution. I check in Tenant but is setted on edition!

if(!tenant.EditionId.HasValue)
                    continue;
                var ed = _context.Editions.FirstOrDefault(t => t.Id == tenant.EditionId.Value);
                var allFeature = _context.EditionFeatureSettings.Where(t=>t.EditionId == ed.Id).ToList();
for(....)

Are you using Abp or AbpZero?

I try and the list is empty (0 element).

i call my method from InitialHostDbBuilder

Ok

I test and I send my feedback, also check if I can change to join in LINQ

Showing 161 to 170 of 200 entries