Skip to content
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

[BUG] .GetRecurringJobs() always returns 'default' for queue even though a differnt queue is used. #2421

Open
sommmen opened this issue Jun 27, 2024 · 1 comment

Comments

@sommmen
Copy link

sommmen commented Jun 27, 2024

I'm scheduling jobs like so;

// Queue orders is 1 higher than the default Queue
[Queue(OPGEventNotificationScheduler.Queue, Order = int.MaxValue / 2 + (1 * 5) + 1)]
internal class OPGEventNotificationScheduledJob : JobBase<OPGEventNotificationScheduledJobOptions>
{
 ...
}
public const string Queue = "opg-event-notification";
 ...
_recurringJobManager
    .AddOrUpdate<OPGEventNotificationScheduledJob>(jobId, 
        Queue,
        x => x.Run(default, new OPGEventNotificationScheduledJobOptions
        {
            SettingId = setting.Id
        }),
        cron,
        new RecurringJobOptions
        {
            TimeZone = _tz
        });

As you can see this job has both the Queue attribute and the Queue parameter has been filled with the same value.
The dashboard picks this up nicely:

image

Then i try to call GetRecurringJobs() and filter on the queue;

 var jobDtos = _jobStorage
     .GetConnection()
     .GetRecurringJobs()
     .ToList();
 
 var recurringJobDtos = jobDtos
     .Where(c => c.Queue == Queue)

And no jobs are found for that queue, to my surprise i see the queue is set to 'default':
image

@samhoov
Copy link

samhoov commented Jul 18, 2024

I have the same problem.

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

No branches or pull requests

2 participants