Files
Amit Prabhudesai 6ac8a8c563 Merged PR 1734798: [Background worker] Dynamically scheduled job intervals via hooks
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No

### Are you introducing any new config? If yes, do you have tests with and without them being set?
No

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Dynamically scheduled job intervals via hooks

----
#### AI description  (iteration 1)
#### PR Classification
This pull request implements a new feature that enables dynamically scheduled job intervals for background worker jobs via hook functions.

#### PR Summary
The pull request refactors background worker job scheduling by replacing the static schedule interval with a hook that dynamically determines the interval. A default hook is provided if none is set, and all related validations and logging have been updated accordingly.
- `oss/pg_documentdb/src/background_worker/background_worker.c`: Updated functions (ValidateJob, RegisterBackgroundWorkerJob, and CanExecuteJob) to retrieve and validate the schedule interval using a hook, including logging when using the default interval.
- `oss/pg_documentdb/include/background_worker/background_worker_job.h`: Replaced the static schedule interval field with a hook function pointer and added a typedef for the scheduling hook.
- Added a default hook function, `GetDefaultScheduleIntervalInSeconds`, that returns a default interval of 60 seconds for jobs without a custom hook.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-07-23 15:56:08 +08:00
..