pub async fn validate_token(&self) {
        let mut last_login = self.last_login.lock().await;
        if (Utc::now() - *last_login).num_seconds() < TOKEN_LIFETIME {
            return;
        }
        info!("Login token expired: {:?}", self.last_login);

        // Lock the token and try to login. Then set the new token and reset last_login.
        let mut token = self.token.lock().await;
        *token = login(&(self.config.username), &(self.config.password)).await;
        *last_login = Utc::now();
    }
// Validate the login token by comparing it to `TOKEN_LIFETIME`. If it has expired,
// a new login attempt will be made.
Validate the login token by comparing it to `TOKEN_LIFETIME`. If it has expired,
a new login attempt will be made.
Validate the login token by comparing it to ` TOKEN_LIFETIME ` . If it has expired a new login attempt will be made .
pub async fn validate_token(&self) {
        let mut last_login = self.last_login.lock().await;
        if (Utc::now() - *last_login).num_seconds() < TOKEN_LIFETIME {
            return;
        }
        info!("Login token expired: {:?}", self.last_login);
        // Lock the token and try to login. Then set the new token and reset last_login.
        let mut token = self.token.lock().await;
        *token = login(&(self.config.username), &(self.config.password)).await;
        *last_login = Utc::now();
    }
pub async fn validate_token ( & self ) { let mut last_login = self . last_login . lock ( ) . await ; if ( Utc :: now ( ) - * last_login ) . num_seconds ( ) < TOKEN_LIFETIME { return ; } info ! ( " " self last_login ) ; // Lock the token and try to login. Then set the new token and reset last_login. let mut token = self . token . lock ( ) . await ; * token = login ( & ( self . config . username ) , & ( self . config . password ) ) . await ; * last_login = Utc :: now ( ) ; }
Validate the login token by comparing it to `TOKEN_LIFETIME`.
Validate the login token by comparing it to ` TOKEN_LIFETIME ` .
&self