fn refresh_jwt_if_needed(fetch_service: &mut FetchService, jwt_string: &str, fetch_task_collection: &mut Vec<FetchTask>)  {
        // The stored jwt may be malformed 
        // By sending a default jwt, it will fail the reauth, logging the user out. This path should never be needed, but would fail in a safe manner.
        let jwt: Jwt = user::extract_payload_from_jwt(jwt_string).unwrap_or_default();


        let current_date = user::get_now();
//        self.log(&format!("current: {:?}, iat: {:?}", current_date, jwt.iat) );
        // If current time > iat + 1 day, then refresh.
        if current_date > jwt.iat + Duration::days(1) {
//            self.log("Refreshing JWT");
            refresh_jwt(jwt_string, fetch_service, fetch_task_collection);
        }
}
/// If a specific amount of time has elapsed since the jwt has been issued, then refresh the jwt.
If a specific amount of time has elapsed since the jwt has been issued, then refresh the jwt.
If a specific amount of time has elapsed since the jwt has been issued then refresh the jwt .
fn refresh_jwt_if_needed(fetch_service: &mut FetchService, jwt_string: &str, fetch_task_collection: &mut Vec<FetchTask>)  {
        // The stored jwt may be malformed 
        // By sending a default jwt, it will fail the reauth, logging the user out. This path should never be needed, but would fail in a safe manner.
        let jwt: Jwt = user::extract_payload_from_jwt(jwt_string).unwrap_or_default();
        let current_date = user::get_now();
//        self.log(&format!("current: {:?}, iat: {:?}", current_date, jwt.iat) );
        // If current time > iat + 1 day, then refresh.
        if current_date > jwt.iat + Duration::days(1) {
//            self.log("Refreshing JWT");
            refresh_jwt(jwt_string, fetch_service, fetch_task_collection);
        }
}
fn refresh_jwt_if_needed ( fetch_service : & mut FetchService , jwt_string : & str , fetch_task_collection : & mut Vec < FetchTask > ) { // The stored jwt may be malformed  // By sending a default jwt, it will fail the reauth, logging the user out. This path should never be needed, but would fail in a safe manner. let jwt : Jwt = user :: extract_payload_from_jwt ( jwt_string ) . unwrap_or_default ( ) ; let current_date = user :: get_now ( ) ; //        self.log(&format!("current: {:?}, iat: {:?}", current_date, jwt.iat) ); // If current time > iat + 1 day, then refresh. if current_date > jwt . iat + Duration :: days ( 1 ) { //            self.log("Refreshing JWT"); refresh_jwt ( jwt_string , fetch_service , fetch_task_collection ) ; } }
If a specific amount of time has elapsed since the jwt has been issued, then refresh the jwt.
If a specific amount of time has elapsed since the jwt has been issued then refresh the jwt .
fetch_service
&mut FetchService
jwt_string
&str
fetch_task_collection
&mut Vec<FetchTask>
fetch_service
&mut FetchService
jwt_string
&str
fetch_task_collection
&mut Vec<FetchTask>