Skip to content

Commit

Permalink
feat: add notifications field to Schedule (#545)
Browse files Browse the repository at this point in the history
Related to https://github.com/apify/apify-core/issues/15493

Adds a `notifications` field to the schedule, so that users can set
whether they get notified when their scheduled run fails to start.

The `notifications` object only has an `email` field for now, but we
might want UI notifications at some point in the future, so I've done it
this way.

From what I could find, this is all that needs doing, right? 

[This
PR](https://github.com/apify/apify-core/pull/15693/files#diff-e443dce6de418714e39866eb1a4ca59f7d4ce49dcbc5cdc692ea07e1be36bacfR436)
will add the bit that sends the notification

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
  • Loading branch information
m-murasovs and B4nan authored May 15, 2024
1 parent 19b8ac4 commit c6f9429
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/resource_clients/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export interface Schedule {
nextRunAt: string;
lastRunAt: string;
actions: ScheduleAction[];
notifications: {
email: boolean;
};
}

export type ScheduleCreateOrUpdateData = Partial<
Expand All @@ -93,6 +96,7 @@ export type ScheduleCreateOrUpdateData = Partial<
| 'isEnabled'
| 'isExclusive'
| 'description'
| 'notifications'
> & {
actions: DistributiveOptional<ScheduleAction, 'id'>[]
}
Expand Down

0 comments on commit c6f9429

Please sign in to comment.