Skip to content

Commit

Permalink
fix(schedule): comparison when checking if a schedule is paused (#2144)
Browse files Browse the repository at this point in the history
## Describe your changes
Check if the schedule is running not any other status

## Issue ticket number and link

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is:
  • Loading branch information
khaliqgant committed May 13, 2024
1 parent 6d712f2 commit 088a852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/lib/services/sync/orchestrator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export class Orchestrator {

const syncSchedule = await syncClient?.describeSchedule(schedule?.schedule_id as string);
if (syncSchedule) {
if (syncSchedule?.schedule?.state?.paused && status !== SyncStatus.PAUSED) {
if (syncSchedule?.schedule?.state?.paused && schedule?.status === ScheduleStatus.RUNNING) {
await updateScheduleStatus(schedule?.id as string, SyncCommand.PAUSE, null, environmentId);
if (status !== SyncStatus.RUNNING) {
status = SyncStatus.PAUSED;
Expand Down

0 comments on commit 088a852

Please sign in to comment.