Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pipeline expiry date #54

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

config.testnet.toml
config.testnet.toml
config/
1 change: 1 addition & 0 deletions bot/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub_struct!(Clone, Deserialize; MyAccount {

pub_struct!(Clone, Deserialize; Renewals {
delay: u64,
expiry_days: i64,
});

pub_struct!(Clone, Deserialize; IndexerServer {
Expand Down
4 changes: 2 additions & 2 deletions bot/src/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn get_auto_renewal_data(
state: &Arc<AppState>,
) -> Result<Vec<DomainAggregateResult>> {
let auto_renews_collection = state.db.collection::<Domain>("auto_renew_flows");
let min_expiry_date = Utc::now() + Duration::days(400);
let min_expiry_date = Utc::now() + Duration::days(config.renewals.expiry_days);
let erc20_addr = to_hex(config.contract.erc20);
let auto_renew_contract = FieldElement::to_string(&config.contract.renewal);
println!("timestamp: {}", min_expiry_date.timestamp());
Expand Down Expand Up @@ -110,7 +110,7 @@ pub async fn get_auto_renewal_altcoins_data(
state: &Arc<AppState>,
) -> Result<Vec<DomainAggregateResult>> {
let auto_renews_collection = state.db.collection::<Domain>("auto_renew_flows_altcoins");
let min_expiry_date = Utc::now() + Duration::days(400); // todo : change to 30 days
let min_expiry_date = Utc::now() + Duration::days(config.renewals.expiry_days);

// Define aggregate pipeline
let pipeline = vec![
Expand Down
1 change: 1 addition & 0 deletions config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ address = "0x123"

[renewals]
delay = 86400 # 24 hours
expiry_days = 30 # number of days before expiry to renew

[indexer_server]
port = [8005, 8007, 8008]
Expand Down
Loading