Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse session when running kcadm commands #328

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Reuse session when running kcadm commands #328

merged 4 commits into from
Nov 18, 2024

Conversation

treydock
Copy link
Owner

Fixes #327

EXPIRES=$(/usr/bin/sed -n -r 's|.*"refreshExpiresAt" : ([0-9]*).*|\1|p' "$CONFIG" || echo "0")
NOW=$(/usr/bin/date +%s%3N)

if [ ! -f "$CONFIG" ] || [ "$EXPIRES" -gt "$NOW" ]; then
Copy link
Contributor

@nblock nblock Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be: if [ ! -f "$CONFIG" ] || [ "$EXPIRES" -lt "$NOW" ]; then otherwise a full login is performed with each invocation.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that, I've updated. Hoping to test locally sometime today with some extra logging in a branch to fully validate this new logic.

@treydock treydock marked this pull request as ready for review November 18, 2024 18:53
@treydock treydock merged commit 8647522 into master Nov 18, 2024
16 checks passed
@treydock treydock deleted the kcadm-config branch November 18, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse existing sessions created by kcadm-wrapper.sh?
2 participants