react-code-dataset / goalert /app /listenevents.go
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
461 Bytes
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
})
}