hyku icon indicating copy to clipboard operation
hyku copied to clipboard

TenantMaintenanceJob issues

Open laritakr opened this issue 5 months ago • 0 comments

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 avatar Aug 31 '24 00:08 laritakr