mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-24 01:40:49 +00:00
fix(authz): retry search memberships if no memberships found (#2869)
This commit is contained in:
15
internal/api/authz/retry.go
Normal file
15
internal/api/authz/retry.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package authz
|
||||
|
||||
import "time"
|
||||
|
||||
//TODO: workaround if org projection is not yet up-to-date
|
||||
func retry(retriable func() error) (err error) {
|
||||
for i := 0; i < 3; i++ {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
err = retriable()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user