mirror of
https://github.com/paralus/paralus.git
synced 2026-02-14 17:49:51 +00:00
[synchronizer] Run once before start listening for database udpate
At a time of restarting Kratos pod, we noticed to update the Kratos config we need modify something in IdP UI to trigger the synchronizer. Instead this change will run synchronizer initially so it will update Kratos config with database IdP entries if any.
This commit is contained in:
@@ -77,6 +77,14 @@ func main() {
|
||||
sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn)))
|
||||
db := bun.NewDB(sqldb, pgdialect.New())
|
||||
|
||||
// synchronize first
|
||||
err := sync(ctx, db, outputPath)
|
||||
if err != nil {
|
||||
log.Errorf("sync failed: %s", err)
|
||||
} else {
|
||||
log.Info("Synchronized successfully")
|
||||
}
|
||||
|
||||
ln := pgdriver.NewListener(db)
|
||||
listen:
|
||||
if err := ln.Listen(ctx, channel); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user