Skip to content

[MODEUSHARV-93] Extend TenantAPI to restore/remove Quartz scheduled job on tenant enable/disable#218

Draft
alb3rtino wants to merge 1 commit into
masterfrom
MODEUSHARV-93
Draft

[MODEUSHARV-93] Extend TenantAPI to restore/remove Quartz scheduled job on tenant enable/disable#218
alb3rtino wants to merge 1 commit into
masterfrom
MODEUSHARV-93

Conversation

@alb3rtino
Copy link
Copy Markdown
Contributor

https://folio-org.atlassian.net/browse/MODEUSHARV-93

Purpose

Currently, if a periodic harvesting job is scheduled for a tenant and the module is subsequently disabled, the job continues to execute. Conversely, when the module is enabled for a tenant that already has a periodic configuration, the configuration is not picked up and no job is scheduled. This change ensures the Quartz scheduled job is kept in sync with module enablement state.

Approach

  • Add TenantAPIImpl extending TenantAPI that removes the scheduled job on tenant disable and restores it from persisted PeriodicConfig on tenant enable/upgrade via loadData.
  • Reorder operations in ErmUsageHarvesterPeriodicAPI so that SchedulingUtil.createOrUpdateJob/deleteJob execute before the HTTP response is sent, ensuring the scheduler state is consistent when the client receives the response.
  • Add integration tests covering enable, disable, re-enable, upgrade, and a no-config scenarios.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

@alb3rtino alb3rtino requested a review from slaemmer April 9, 2026 09:25
@alb3rtino alb3rtino marked this pull request as draft April 14, 2026 21:16
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

Successfully merging this pull request may close these issues.

1 participant