Skip to content

Commit

Permalink
Revert "Refactor setting authenticatedPriority = defaultPriority outs…
Browse files Browse the repository at this point in the history
…ide if block #56"

This reverts commit a183af2.
  • Loading branch information
patrick-austin committed Jan 16, 2025
1 parent 36230d1 commit d25db61
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/org/icatproject/topcat/PriorityMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,20 @@ public PriorityMap() {
* @param authenticatedString The value read from the run.properties file
*/
private void setAuthenticatedPriority(String authenticatedString) {
String msg = "";
authenticatedPriority = Integer.valueOf(authenticatedString);
if (authenticatedPriority < 1 && defaultPriority >= 1) {
msg += "queue.priority.authenticated disabled with value " + authenticatedString;
String msg = "queue.priority.authenticated disabled with value " + authenticatedString;
msg += " but queue.priority.default enabled with value " + defaultPriority;
msg += "\nAuthenticated users will use default priority if no superseding priority applies";
logger.warn(msg);
authenticatedPriority = defaultPriority;
} else if (authenticatedPriority >= 1 && authenticatedPriority > defaultPriority) {
msg += "queue.priority.authenticated enabled with value " + authenticatedString;
String msg = "queue.priority.authenticated enabled with value " + authenticatedString;
msg += " but queue.priority.default supersedes with value " + defaultPriority;
} else {
return; // Explicit authenticatedPriority OK, so no need to warn or use defaultPriority
msg += "\nAuthenticated users will use default priority if no superseding priority applies";
logger.warn(msg);
authenticatedPriority = defaultPriority;
}
logger.warn(msg + "\nAuthenticated users will use default priority if no superseding priority applies");
authenticatedPriority = defaultPriority;
}

/**
Expand Down

0 comments on commit d25db61

Please sign in to comment.