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

TenantMaintenanceJob issues #2309

Open
laritakr opened this issue Aug 31, 2024 · 0 comments
Open

TenantMaintenanceJob issues #2309

laritakr opened this issue Aug 31, 2024 · 0 comments
Labels

Comments

@laritakr
Copy link
Collaborator

laritakr commented Aug 31, 2024

Descriptive summary

Auto-scheduled tenant jobs need to be reworked.

Rationale

Current logic in the main branch does not work:

  • On main branch, TenantMaintenanceJob fails when it tries to call Account.each rather than Account.find_each

If the above is fixed...

  • Method find_job in account.rb calls ActiveJob::Base.find_job(klass: klass, tenant_id: self.tenant) which always returns nil. It does not find enqueued jobs.

Expected behavior

Each job gets scheduled only once per tenant. If job is already enqueued, it does not get enqueued another time.

Actual behavior

Job fails because method each is not valid on class Account. If this is fixed, each time the worker starts, it enqueues more jobs, regardless of whether they are already in the queue.

Steps to reproduce the behavior

Related work

@laritakr laritakr added the bug label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant