Skip to content

ISchedulerListener is firing twice for events. #1269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DRAirey1 opened this issue Nov 17, 2024 · 2 comments
Closed

ISchedulerListener is firing twice for events. #1269

DRAirey1 opened this issue Nov 17, 2024 · 2 comments

Comments

@DRAirey1
Copy link

DRAirey1 commented Nov 17, 2024

I have a simple scheduler that I'm loading from an SQL table (that resembles the Quartz records):

            // Create, configure and start the scheduler.
            this.scheduler = await this.schedulerFactory.GetScheduler(cancellationToken);
            this.scheduler.JobFactory = this.jobFactory;
            this.scheduler.ListenerManager.AddSchedulerListener(this.schedulerListener);
            await this.scheduler.Start(cancellationToken).ConfigureAwait(false);

I've verified with logging that this code is only run once. I've verified with logging that the job is only running once.
The listener is a trivial implementation of an IScheduleListener:

        /// <inheritdoc/>
        public async Task JobAdded(IJobDetail jobDetail, CancellationToken cancellationToken = default)
        {
            this.logger.LogInformation($"Starting ({jobDetail.Key.Group}, {jobDetail.Key.Name}).");
        }
        

When I run this program, I get:

info: ThetaRex.Market.Jobs.JobService[0]
      Starting (ETrade, Start Quote Service Job).
info: ThetaRex.Market.Jobs.JobService[0]
      Starting (ETrade, Start Quote Service Job).

The listener task is getting called twice for every job I add and twice for every job that is deleted.

@melloware
Copy link
Contributor

@DRAirey1 is this .NET code? This is the Java library GitHub you want Quartz.Net which is not related to this project.

@melloware
Copy link
Contributor

Can you close it I don't have permissions and you opened the ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants