Skip to content

Commit 582e771

Browse files
authored
Merge pull request #129 from filecoin-project/fix/get_env_var_or_default_in_process_allocator_file
get_env_var_or_default_in_process_allocator_file
2 parents c086314 + 0acd435 commit 582e771

File tree

1 file changed

+3
-8
lines changed
  • fplus-lib/src/core/allocator

1 file changed

+3
-8
lines changed

fplus-lib/src/core/allocator/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use octocrab::models::repos::ContentItems;
22

3+
use crate::config::get_env_var_or_default;
34
use crate::{base64::decode_allocator_model, error::LDNError, external_services::github::GithubWrapper};
45

56
use self::file::AllocatorModel;
@@ -8,14 +9,8 @@ pub mod file;
89

910
pub async fn process_allocator_file(file_name: &str) -> Result<AllocatorModel, LDNError> {
1011

11-
let owner = std::env::var("ALLOCATOR_GOVERNANCE_OWNER").unwrap_or_else(|_| {
12-
log::warn!("ALLOCATOR_GOVERNANCE_OWNER not found in .env file");
13-
"Allocator-Governance-Staging".to_string()
14-
});
15-
let repo = std::env::var("ALLOCATOR_GOVERNANCE_REPO").unwrap_or_else(|_| {
16-
log::warn!("ALLOCATOR_GOVERNANCE_REPO not found in .env file");
17-
"fidlabs".to_string()
18-
});
12+
let owner = get_env_var_or_default("ALLOCATOR_GOVERNANCE_OWNER");
13+
let repo = get_env_var_or_default("ALLOCATOR_GOVERNANCE_REPO");
1914
let branch = "main";
2015
let path = file_name.to_string();
2116

0 commit comments

Comments
 (0)