Giter Site home page Giter Site logo

hangfire.performcontextaccessor's Issues

not support hangfire.console? I need use it for WriteProgressBar, but not work

thanks for your work on this project.

I’ve been using Hangfire with a custom attribute to dynamically schedule and invoke jobs, and I pass specific parameters to them.

Handler

var x = scope.ServiceProvider.GetRequiredService<IPerformContextAccessor>();
var result = !method.GetParameters().Any(t => t.ParameterType == typeof(PerformContext)) ? (Task?)method.Invoke(obj, new object[] { 
tenants }) :
    (Task?)method.Invoke(obj, new object?[] { tenants, x.PerformingContext });

And here is the job method that is intended to display progress:

[CustomArrtibute("0 14 * * *")]
public Task ScheduleJob(IEnumerable<long> tenants, PerformContext performContext)
{
    var bar = performContext.WriteProgressBar(10);

    for (var i = 0; i <= 100; i += 10)
    {
        bar.SetValue(i); 
        System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(200));
    }
    Console.WriteLine("do " + DateTime.Now);

    return Task.CompletedTask;
}

However, the bar.SetValue(i) method does not seem to be functioning as expected. The progress bar does not reflect the current progress state during the job execution.

Broken compatibility with .NetStandart 2.0

Hello,

I would like to use your package in a .net core 2.2 application (which is supposed to be doable) but you are using a reference which required at least .net core 3.1

The identified issue is with the package Microsoft.Extensions.DependencyInjection.Abstractions version 6+

You can find more information here : dotnet/runtime#63744

For reference, you can find the compatibility matrix here : https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

Could you let me know if you will provide a version compatible with .net core 2.0+ ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.