Issue Description
i noticed that the logic of this specific format:
await this.setupNextNotification();
if (busy !== false) {
await this.setupNextStatusChange();
}
repeats in multiple parts of the code for service.ts.
Change proposed
We can change this to make the code a bit more readable and easy to maintain by creating a common helper function that can be used across the code
private async updateSchedulers(busy?: boolean): Promise<void> {
await this.setupNextNotification();
// If busy is undefined, we assume true
if (busy !== false) {
await this.setupNextStatusChange();
}
}
What this does:
makes the code more readable and cleaner. and easier to maintain in the future.