Skip to content

Commit

Permalink
feat: add support for entitlements events
Browse files Browse the repository at this point in the history
We add a basic highwatermark cache to prevent recalculations multiple
times. This will be more important when the ingest part is ready.
  • Loading branch information
turip committed Jul 31, 2024
1 parent 7bad3e6 commit 0c301b9
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 228 deletions.
5 changes: 3 additions & 2 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"syscall"
"time"

"entgo.io/ent/dialect/sql"
entDialectSQL "entgo.io/ent/dialect/sql"
health "github.com/AppsFlyer/go-sundheit"
healthhttp "github.com/AppsFlyer/go-sundheit/http"
"github.com/ClickHouse/clickhouse-go/v2"
Expand Down Expand Up @@ -298,6 +298,7 @@ func main() {
debugConnector := debug.NewDebugConnector(streamingConnector)
entitlementConnRegistry := &registry.Entitlement{}

// Initialize Postgres
if conf.Entitlements.Enabled {
pgClients, err := initPGClients(conf.Postgres)
if err != nil {
Expand Down Expand Up @@ -536,7 +537,7 @@ func initNamespace(config config.Configuration, namespaces ...namespace.Handler)
}

type pgClients struct {
driver *sql.Driver
driver *entDialectSQL.Driver
client *db.Client
}

Expand Down
4 changes: 0 additions & 4 deletions internal/cmd/README.md

This file was deleted.

41 changes: 0 additions & 41 deletions internal/cmd/clickhouse/client.go

This file was deleted.

40 changes: 0 additions & 40 deletions internal/cmd/postgres/client.go

This file was deleted.

28 changes: 0 additions & 28 deletions internal/cmd/streaming/connector.go

This file was deleted.

96 changes: 0 additions & 96 deletions internal/common/entitlement/connectors.go

This file was deleted.

Loading

0 comments on commit 0c301b9

Please sign in to comment.