Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/tokscale-cli/src/commands/usage/kimi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub fn fetch() -> Result<UsageOutput> {
.access_token
.clone()
.ok_or_else(|| anyhow::anyhow!("No Kimi access token."))?;
let stored_refresh_token = creds.refresh_token.clone();
let mut stored_refresh_token = creds.refresh_token.clone();
let expires_at = creds.expires_at;

let rt = tokio::runtime::Builder::new_current_thread()
Expand All @@ -179,6 +179,7 @@ pub fn fetch() -> Result<UsageOutput> {
if let Some(new_token) = refreshed.access_token.clone() {
access_token = new_token;
if let (Some(new_rt), Some(expires_in)) = (&refreshed.refresh_token, refreshed.expires_in) {
stored_refresh_token = Some(new_rt.clone());
save_credentials(&access_token, new_rt, expires_in);
}
}
Expand Down