Skip to content

Commit

Permalink
chore: add retry around token set
Browse files Browse the repository at this point in the history
  • Loading branch information
mjnagel committed Dec 10, 2024
1 parent fdeca0e commit fe1f4a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pepr/operator/controllers/keycloak/client-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { fetch, K8s, kind } from "pepr";
import { Component, setupLogger } from "../../../logger";
import { Store } from "../../common";
import { Sso, UDSPackage } from "../../crd";
import { getOwnerRef, purgeOrphans, sanitizeResourceName } from "../utils";
import { getOwnerRef, purgeOrphans, retryWithDelay, sanitizeResourceName } from "../utils";
import { Client, clientKeys } from "./types";

let apiURL =
Expand Down Expand Up @@ -173,7 +173,7 @@ async function syncClient(

// Write the new token to the store
try {
await Store.setItemAndWait(name, client.registrationAccessToken!);
await retryWithDelay(() => Store.setItemAndWait(name, client.registrationAccessToken!), log);
} catch (err) {
throw Error(
`Failed to set token in store for client '${client.clientId}', package ` +
Expand Down

0 comments on commit fe1f4a5

Please sign in to comment.