Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 11 15:44
    lahma commented #1192
  • May 11 13:28
    sjd2021 commented #1192
  • May 11 13:27
    sjd2021 edited #1192
  • May 11 09:13
    lahma commented #1192
  • May 11 07:36
    sjd2021 edited #1192
  • May 11 07:34
    sjd2021 opened #1192
  • May 10 19:17
    asulwer commented #781
  • May 06 06:27
    odesyatnyk commented #1187
  • May 05 18:10
    lahma edited #1189
  • May 05 18:09
    lahma milestoned #1189
  • May 05 18:09
    lahma commented #1189
  • May 05 18:09
    lahma closed #1189
  • May 05 17:58
    arielmoraes synchronize #1189
  • May 05 14:27
    lahma closed #1187
  • May 05 14:27
    lahma commented #1187
  • May 05 14:27
    lahma closed #1190
  • May 05 14:25
    lahma milestoned #1187
  • May 05 13:53
    lahma commented #1191
  • May 05 13:25
    Pinguwien edited #1191
  • May 05 13:24
    Pinguwien edited #1191
Xorcist
@Xorcist77
I have an externally configured job (no trigger), that I fire with scheduler.TriggerJob(JobKey), which works fine, until I want to fire it with scheduler.TriggerJob(JobKey, JobDataMap), it seems that while my JobDataMap has data in it before the call, inside the job referencing context.JobDetail.JobDataMap give be 0 items. Any ideas why this might be?
oh... my bad, looks like I need to be using context.Trigger.JobDataMap, issue resolved.
Albert Hives
@ahives
Hi, I have a question: I am trying to add scheduling to my OSS library. The thing is, I need it to be able to schedule vastly different job types. In other words, I have custom job A that has completely different parameters than custom job B. Would I create the job factory to have all of the possible parameters and just figure out within the NewJob method which custom job (A or B in this example) to call?
Marko Lahma
@lahma
Can you use job data map to parameterize?
Albert Hives
@ahives
For some I think it would make sense to do it that way. However, if these are two completely different jobs should I be thinking about registering different schedulers?
Albert Hives
@ahives
after looking at this for a bit, it looks like I need different schedulers. Is this possible from the same application? (I guess it probably would be a matter of registering the objects in Autofac) @lahma
techiebuddhas
@techiebuddhas
Guys do we have an option to read job store from json file in quartz.net, please treat this as a newbie question :)
Marko Lahma
@lahma
Only XML supported at the moment
Khoa Nguyen
@KhoaSydney
Hi guys,
Im currently using Quart.net v3 to schedule some job to be run. It is working on my local but when I deploy onto my Test site, it does not exeucte at all. There is no error
Any idea on why it does not get execute?
DrCopyPaste
@DrCopyPaste
Is AssemblyInfo.cs a relic waiting to be deleted, or am I doing something wrong?
I am asking because Build fails for me directly after checkout (latest master, VS 2019)
I see that src/AssemblyInfo.cs is referenced from for example Quartz.csproj but it does not exist (log says deleted 11-2-2014?)
Marko Lahma
@lahma
Build.cmd generates it
DrCopyPaste
@DrCopyPaste
ah of course, thx :)
sylvaingir
@sylvaingir
Hi @lahma, one quick question: Do you plain to release milestone 3.1 anytime soon? I'm being impacted by the TimeZoneConverter issue that is already fixed by @klinki
Marko Lahma
@lahma
Have you tried the MyGet feed for quick remedy?
sylvaingir
@sylvaingir
I didn't know about that, I'll give it a shot. thanks for pointing me to it! :)
Michael
@michaellwest
Thanks for such a great product!
Marko Lahma
@lahma
Glad that you enjoy it :thumbsup:
Michael
@michaellwest
I have a cron trigger scheduled for weekends. If I provide a startat time which is in the past and then run the service, should the weekend schedule fire once?
Marko Lahma
@lahma
Depends. Cannot know if it misfired without persistence
Michael
@michaellwest
Looks like the docs say FireOnceNow is the default which likely applies in my case.
MikoĊ‚aj Kalwa
@mikolajkalwa

Hello, I'll be pretty straightforward. How do I setup Quartz.Net with DI?
I'm trying to follow the docs
https://www.quartz-scheduler.net/documentation/quartz-3.x/packages/hosted-services-integration.html
https://www.quartz-scheduler.net/documentation/quartz-3.x/packages/microsoft-di-integration.html
but I can't manage to make it work.

I added the following piece of code into ConfigureServices method

services.AddQuartz(q =>
                {
                    q.UseMicrosoftDependencyInjectionScopedJobFactory();

                    var jobKey = new JobKey("awesome job", "awesome group");

                    q.AddJob<ExampleJob>(j => j
                        .StoreDurably()
                        .WithIdentity(jobKey)
                        .WithDescription("my awesome job")
                    );

                    q.AddTrigger(t => t
                        .WithIdentity("Simple Trigger")
                        .ForJob(jobKey)
                        .StartNow()
                        .WithSimpleSchedule(x => x.WithInterval(TimeSpan.FromSeconds(10)).RepeatForever())
                        .WithDescription("my awesome simple trigger")
                    );
                })
                .AddQuartzHostedService(options =>
                {
                    options.WaitForJobsToComplete = true;

                })
                .AddTransient<ExampleJob>();

It doesn't throw any exception, the job just never runs. I'm struggeling with it for a few hours.
I'm clearly missing something.

Albert Hives
@ahives
hi I have the same question as @mikolajkalwa
I don't see any examples where it shows setting up the scheduler from the container, etc.
I'm using the following code but it doesn't seem to work
var factory = new StdSchedulerFactory();
var scheduler = await factory.GetScheduler();

await scheduler.Start();

Thread.Sleep(5000);

scheduler.Shutdown(true);
Albert Hives
@ahives
I solved it
@mikolajkalwa just write the following code in your Program.cs
static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .UseSerilog()
                .ConfigureServices((hostContext, services) =>
                {
                    services.AddQuartz(q =>
                    {
...
                    });

                    services.AddTransient<>();

                    services.AddQuartzHostedService(q =>
                    {
                        q.WaitForJobsToComplete = true;
                    });
                });
Reference the following NuGet packages
Microsoft.Extensions.Hosting
Serilog.Extensions.Hosting
Quartz.Extensions.Hosting
then add this line of code in your Main.cs
await CreateHostBuilder(args).Build().RunAsync();
thats it
startewho
@startewho
Hi, i used the quartznet in ioc mode.and when i dynimic add the Job using the refletion. and i found there is only one AddJob<T> method.
so i did a pull requst ,add a method AddJob(Type jobType). becasue my poor English.
and i do not know is my fomart is right?
And aslo it ci in linux test seems wrong,but i check the error message.it seems not my change result the error. and i 'm not sure .so need a helper maybe
Marko Lahma
@lahma
thanks for the the PR! I'd like to see a small tweak to it, otherwise all good. the linux test seems a bit flaky, don't mind about that
startewho
@startewho
hi,may be i found a bug in quartz.net.when i use the msft's di .and i can add job on the startup .when i want to dynimic add a job
it shows add successs,and when it run the job .it show the the error ERROR|Quartz.Core.ErrorLogger|An error occurred instantiating job to be executed. job= 'JG_1.J_2'
it seems that the add normal scheduler does not conisder the di. so there is no info to invoke a instance of job
startewho
@startewho
and i found it maybe a di 's limit .it can not dynimic add JobType
so i fix it like this:when a job type doen't should start ,and i also reg it in the di.when i want it run .it works.
Marko Lahma
@lahma