mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-30 17:37:25 +02:00
replace GetAllPages with InitialSync, improve merge performance (#1624)
* replace GetAllPages with InitialSync, improve merge performance * fmt proto * add test for base64 function * add sync test * go mod tidy Co-authored-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
ba55fec67c
commit
aad8ac2e61
10 changed files with 298 additions and 214 deletions
|
@ -91,7 +91,7 @@ func (a *Authorize) runDataTypeSyncer(ctx context.Context, typeURL string) error
|
|||
ctx, span := trace.StartSpan(ctx, "authorize.dataBrokerClient.GetAll")
|
||||
backoff := backoff.NewExponentialBackOff()
|
||||
for {
|
||||
res, err := databroker.GetAllPages(ctx, a.state.Load().dataBrokerClient, &databroker.GetAllRequest{
|
||||
res, err := databroker.InitialSync(ctx, a.state.Load().dataBrokerClient, &databroker.SyncRequest{
|
||||
Type: typeURL,
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -105,10 +105,10 @@ func (a *Authorize) runDataTypeSyncer(ctx context.Context, typeURL string) error
|
|||
}
|
||||
|
||||
serverVersion = res.GetServerVersion()
|
||||
recordVersion = res.GetRecordVersion()
|
||||
|
||||
for _, record := range res.GetRecords() {
|
||||
a.updateRecord(record)
|
||||
recordVersion = record.GetVersion()
|
||||
}
|
||||
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue