File size: 461 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package app

import (
	"context"

	"github.com/target/goalert/permission"
	"github.com/target/goalert/util/log"
	"github.com/target/goalert/util/sqlutil"
)

func (app *App) setupListenEvents() {
	app.events = sqlutil.NewListener(app.pgx)
	app.events.Handle("/goalert/config-refresh", func(ctx context.Context, payload string) error {
		permission.SudoContext(ctx, func(ctx context.Context) {
			log.Log(ctx, app.ConfigStore.Reload(ctx))
		})
		return nil
	})
}