Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1 Scheduled Jobs / Third Party Sync Migration (#171)
* Added a scheduled job manager to handle the creation of cron jobs located in application.properties * Added main logic, storing jobs to database and parsing them on retrieval / updating. Added job and trigger listeners to handle updating the job status before and after execution. * Added ScheduledJobDTO for API endpoints and handled a possible row insert race condition exception. * Fix failing maven tests. * Added SQL migration. Removed isAllowedExecutionOverlap, as the DisallowConcurrentExecution annotation can be applied to the job. * Changed conditional property to match current quartz condition. * Attached the job properties to the Job Type in the enum definition * Added Slack Notification for failed third party sync * Fix failing maven tests * Trigger mvn tests again * Fix maven tests ? * Fix exception thrown if @value is missing * Changed condition on property value * Send pollable task ID in notification and other small changes. * Denormalized job type and job status. Added version to base scheduled job properties * Cleanup & Set end / start date to null depending on current job status * Added more ScheduledJob endpoints and veto the job execution if its disabled. * Added ScheduledJobResponse for structured API responses * Use UUID for job id * Fix failing tests * Fix deadlock that would occur in audit table when two syncs started at the same time * Clean up map * Refactoring & Added PagerDuty incident creation on job failure * Add flyway schema & Add PD incident title to configuration * Added configuration examples, Fix deadlock occurring at the method level, Made endpoints require POST request * Comment changes * Add starting tests, ensuring they work in HSQL * Tests check * Fix tests by not using new application context * Fix tests by manually adding rows flyway would handle that HSQL doesn't do * Review comments to fix up SQL schema * Review comments, ZonedDateTime & Foreign Key, BIT changes * Capture PathVariable using UUID class * Review comment changes and refactoring * Revert scheduler change * Change endpoints back to POST methods * Rename Job Status and Type, extra logging * Use HashSet instead of list, throw run time error if duplicate uuids are found * Custom timeout for third party sync in application.properties * Add metric for third party syncs that were scheduled and pagerduty incidents/resolves that fail. * Renamed Status enum for WS response, disallow triggering disabled jobs * Added auto incremented primary key * Fix tests * Small refactor * Remove unique key, added insert statements for hsqldb * Log pollable task and scheduled job url on PD failure * Added Integration Tests, Unique key on UUID column * Constructor Autowire for WS * Update tests to use ID watcher and removed redundant tests * Adding queuing up a manual re-trigger * Only set job status as Scheduled if the job was only inserted into the db now * Extend base entity and rename to isEnabled * Use waitForPollableTask instead of task.get()
- Loading branch information