Spaces:
Running
Running
Upload 2 files
Browse files- src/api.rs +9 -2
src/api.rs
CHANGED
|
@@ -60,8 +60,15 @@ pub struct APIClient {
|
|
| 60 |
|
| 61 |
impl APIClient {
|
| 62 |
pub fn new() -> Self {
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
}
|
| 66 |
|
| 67 |
pub fn new_with_arl(arl: String) -> Self {
|
|
|
|
| 60 |
|
| 61 |
impl APIClient {
|
| 62 |
pub fn new() -> Self {
|
| 63 |
+
match env::var("ARL") {
|
| 64 |
+
Ok(arl) if !arl.trim().is_empty() => Self::new_with_arl(arl),
|
| 65 |
+
_ => Self {
|
| 66 |
+
client: Client::builder().build().unwrap(),
|
| 67 |
+
license_token: String::new(),
|
| 68 |
+
check_form: String::new(),
|
| 69 |
+
renew_instant: None,
|
| 70 |
+
},
|
| 71 |
+
}
|
| 72 |
}
|
| 73 |
|
| 74 |
pub fn new_with_arl(arl: String) -> Self {
|