Activities of "liangshiwei"

Hi,

Usually, it is already configured in the new microservice template.

This is the way to change the migrations table name.

Did you build it in Release mode as that is needed to activate the mentioned code? Will build fine in debug mode but not in Release mode as AccessTokenKey isn't declared.

Ok, i will try

you can custom the HttpErrorComponent

https://abp.io/docs/latest/framework/ui/angular/component-replacement

Hi,

I will fix it in the next patch version. You can try this

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IBackgroundWorkerManager), typeof(HangfireBackgroundWorkerManager))]
public class MyHangfireBackgroundWorkerManager : HangfireBackgroundWorkerManager
{
    public MyHangfireBackgroundWorkerManager(IServiceProvider serviceProvider) : base(serviceProvider)
    {
    }

    public override async Task AddAsync(IBackgroundWorker worker, CancellationToken cancellationToken = default)
    {
        switch (worker)
        {
            case IHangfireBackgroundWorker hangfireBackgroundWorker:
            {
                var unProxyWorker = ProxyHelper.UnProxy(hangfireBackgroundWorker);
                if (hangfireBackgroundWorker.RecurringJobId.IsNullOrWhiteSpace())
                {
                    RecurringJob.AddOrUpdate(
                        () => ((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(cancellationToken),
                        hangfireBackgroundWorker.CronExpression, hangfireBackgroundWorker.TimeZone,
                        hangfireBackgroundWorker.Queue);
                }
                else
                {
                    RecurringJob.AddOrUpdate(hangfireBackgroundWorker.RecurringJobId,
                        () => ((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(cancellationToken),
                        hangfireBackgroundWorker.CronExpression, hangfireBackgroundWorker.TimeZone,
                        hangfireBackgroundWorker.Queue);
                }

                break;
            }
            case AsyncPeriodicBackgroundWorkerBase or PeriodicBackgroundWorkerBase:
            {
                var timer = worker.GetType()
                    .GetProperty("Timer", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(worker);

                var period = worker is AsyncPeriodicBackgroundWorkerBase
                    ? ((AbpAsyncTimer?)timer)?.Period
                    : ((AbpTimer?)timer)?.Period;

                if (period == null)
                {
                    return;
                }

                var unProxiedType = ProxyHelper.GetUnProxiedType(worker);
                var adapterType =
                    typeof(HangfirePeriodicBackgroundWorkerAdapter<>).MakeGenericType(unProxiedType);
                var workerAdapter = (Activator.CreateInstance(adapterType) as IHangfireBackgroundWorker)!;

                RecurringJob.AddOrUpdate(unProxiedType.Name, () => workerAdapter.DoWorkAsync(cancellationToken), GetCron(period.Value),
                    workerAdapter.TimeZone, workerAdapter.Queue);

                break;
            }
            default:
                await base.AddAsync(worker, cancellationToken);
                break;
        }
    }
    
    protected override string GetCron(int period)
    {
        var time = TimeSpan.FromMilliseconds(period);
        string cron;

        if (time.TotalSeconds <= 59)
        {
            cron = $"*/{time.TotalSeconds} * * * * *";
        }
        else if (time.TotalMinutes <= 59)
        {
            cron = $"*/{time.TotalMinutes} * * * *";
        }
        else if (time.TotalHours <= 23)
        {
            cron = $"0 */{time.TotalHours} * * *";
        }
        else if(time.TotalDays <= 31)
        {
            cron = $"0 0 0 1/{time.TotalDays} * *";
        }
        else
        {
            throw new AbpException(
                $"Cannot convert period: {period} to cron expression, use HangfireBackgroundWorkerBase to define worker");
        }

        return cron;
    }
}

for example:

app.Use((httpContext, next) =>
{
    var logger = httpContext.RequestServices.GetRequiredService<ILogger<YourModuleClass>>();
    foreach (var header in httpContext.Request.Headers)
    {
        logger.LogInformation($"----------Request header: {header.Key}: {header.Value}----------");
    }

    return next();
});

i don't know

gateway project is enough.

if still not working you can add a middleware to output the HTTP request info to logs to see the request host.

Hi,

Sorry about that. We are fixing the problem.

your ticket was refunded.

Hi,

Sorry for that, we are fixing the problem.

ok, thanks for the info

Showing 1561 to 1570 of 6693 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 25, 2025, 06:16
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.