Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:53
    lahma commented #1367
  • 14:53
    lahma closed #1367
  • 14:36
    drieseng commented #1363
  • 14:34
    drieseng opened #1367
  • 14:02
    drieseng commented #1363
  • 14:01
    drieseng synchronize #1363
  • 13:55
    lahma commented #1364
  • 13:55
    lahma closed #1364
  • 13:53
    drieseng commented #1364
  • 13:47
    drieseng synchronize #1364
  • 13:46
    lahma commented #1366
  • 13:43
    lahma commented #1365
  • 13:43
    drieseng opened #1366
  • 13:36
    drieseng opened #1365
  • 13:35
    lahma commented #1364
  • 13:33
    lahma commented #1363
  • 13:33
    lahma commented #1363
  • 13:24
    drieseng opened #1364
  • 13:07
    drieseng commented #1363
  • 13:01
    drieseng opened #1363
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
Akshansh Jain
@akshanshjain95
Hi, while deleting a job using scheduler.deleteJob(jobDetails.getKey());, it takes from 1 sec to 6 sec sometimes. Is this normal? I'm using JobStoreTX and number of rows in JOB_DETAILS and TRIGGERS tables are around 1.5 million only.
Marko Lahma
@lahma
Which database, have you created indexes in the DDL scripts?
Your syntax looks almost like the Java version (this channel is about the .NET version, but same principles apply)
Akshansh Jain
@akshanshjain95

I'm using MySQL db, I don't see any DDL scripts, but from DB i can tell -

PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `SCHED_NAME` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), on QRTZ_TRIGGERS

and

PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`) on QRTZ_JOB_DETAILS.

I'm assuming that the tables must have been created initially without the scripts. Not very sure about it as the people worked on it are no longer in contact with us :D

Yes, this is Java code, but couldn't find a Java gitter so asking here.