Activities of "MichelZ"

I want on shutdown of the Application that hosts the Background Workers to issue a cancellation token that can somehow be used/injected as ICancellationTokenProvider,

Currently not possible.

OK, thank you

Hi, I don't think this is what I need, altough might be helpful.

Maybe I need to describe it differently what I want. I want on shutdown of the Application that hosts the Background Workers to issue a cancellation token that can somehow be used/injected as ICancellationTokenProvider, as we (currently) exclusively use the ICancellationTokenProvider to cancel work in the Repositories.

How would AddBackgroundWorkerAsync with a CancellationToken parameter work here?

Thanks

Thanks, but this is not what I'm asking (I think)

Background WORKERS already support CancellationTokens:

public abstract class HangfireBackgroundWorkerBase : BackgroundWorkerBase, IHangfireBackgroundWorker`
{
    public string RecurringJobId { get; set; }
    public string CronExpression { get; set; }
    public TimeZoneInfo TimeZone { get; set; }
    public string Queue { get; set; }
    public abstract Task DoWorkAsync(CancellationToken cancellationToken = default);
    protected HangfireBackgroundWorkerBase()
   {
        TimeZone = null;
        Queue = "default";
    }
}

But here, I have to pass the CancellationToken down to my repository methods (which I don't have to do in the normal Http project, as it uses the HttpContextCancellationTokenProvider)

My question is if I can somehow make BackgroundWorkers work the same, without adding CancellationToken overloads to the Repository methods, as my Repository methods use GetCancellationToken() to pass the token from the ICancellationTokenProvider

Thanks

  • ABP Framework version: v6.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

We are using ICancellationTokenProvider for our repositories with the GetCancellationToken() method, so we don't have to sprinkle the CancellationTokens into every method. This works well with the HttpContext Token Provider.

We would like to do the same thing with Background Workers (we are using HangfireBackgroundWorkerBase) - but we are not sure how to... any pointers? Or do we need to convert our Repositories to take CancellationTokens as parameters for this to work properly?

Thanks

OK, I don't think OpenIDDict has anything to do with the actual login... I was mislead by the migration removing the reference to Microsoft.AspNetCore.Authentication.OpenIdConnect (as it was referenced by Identity Server), so I thought it was functionality provided by Identity Server when the .AddOpenIdConnect() call was not available anymore.

  • ABP Framework version: v6.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

I haven't found the answer to this... with Identity Server it was possible to use Azure AD to log into ABP. Is this still possible while using OpenIDDict?

We are in the process of migrating from IDS to OpenIDDict, but we haven't found a documented answer for this yet...

Thanks

I think for CORS you need to use * instead of {0}

One more question, is there an easy way to extend the Tenant class? I want to add some properties and data columns to it.

Have you looked at this? https://docs.abp.io/en/abp/latest/Module-Entity-Extensions

Yes, according to the GitHub issue this should be enough. (Also make sure you have Redis configured correctly)

No need to change anything in the background service level code.

https://github.com/abpframework/abp/issues/10322

Showing 1 to 10 of 40 entries
Made with ❤️ on ABP v8.3.0-preview Updated on July 05, 2024, 15:13