mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-04 17:48:35 +00:00
feat: use notifiers on schedule (#362)
* fix potential memory leak with time.After * add new background service to manage scheduled notifications * update docs * remove old js reference * closes #278 * tidy
This commit is contained in:
parent
975e636fb6
commit
840d220d4f
16 changed files with 201 additions and 52 deletions
|
@ -73,6 +73,16 @@ func (r *NotifierRepository) GetByGroup(ctx context.Context, groupID uuid.UUID)
|
|||
Where(notifier.GroupID(groupID)).
|
||||
Order(ent.Asc(notifier.FieldName)).
|
||||
All(ctx)
|
||||
|
||||
return r.mapper.MapEachErr(notifier, err)
|
||||
}
|
||||
|
||||
func (r *NotifierRepository) GetActiveByGroup(ctx context.Context, groupID uuid.UUID) ([]NotifierOut, error) {
|
||||
notifier, err := r.db.Notifier.Query().
|
||||
Where(notifier.GroupID(groupID), notifier.IsActive(true)).
|
||||
Order(ent.Asc(notifier.FieldName)).
|
||||
All(ctx)
|
||||
|
||||
return r.mapper.MapEachErr(notifier, err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue