Skip to content

Commit

Permalink
No auth while waiting for build to finish
Browse files Browse the repository at this point in the history
When waiting for a group build to finish in `PncBuilder`, get a new
anonymous GroupBuildClient to know the state of the group build.

If we use the regular groupBuildClient, its access token might have
already expired and we'll get a 401 error eventually.
  • Loading branch information
thescouser89 committed Feb 28, 2024
1 parent 0938e78 commit dac07ab
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ boolean isSuccessfullyFinished(String groupBuildId) {
// log set to info for CPaaS to detect infinite loop
log.info("Checking if group build {} is successfully finished", groupBuildId);
try {
GroupBuild groupBuild = groupBuildClient.getSpecific(groupBuildId);
GroupBuildClient anonymousGroupBuildClient = new GroupBuildClient(getPncConfiguration(false));
GroupBuild groupBuild = anonymousGroupBuildClient.getSpecific(groupBuildId);
switch (groupBuild.getStatus()) {
case BUILDING:
return false;
Expand Down

0 comments on commit dac07ab

Please sign in to comment.