Skip to content

Commit

Permalink
increase interval of query hub msg
Browse files Browse the repository at this point in the history
  • Loading branch information
shenao78 committed Jun 23, 2024
1 parent 8cbee5a commit c29711f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions customs/bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub const MAX_REQUESTS_PER_BATCH: usize = 10;
pub const BATCH_QUERY_LIMIT: u64 = 20;

pub const INTERVAL_PROCESSING: Duration = Duration::from_secs(5);
pub const INTERVAL_QUERY_HUB: Duration = Duration::from_secs(60);
pub const FEE_ESTIMATE_DELAY: Duration = Duration::from_secs(60 * 60);

/// The minimum fee increment for transaction resubmission.
Expand Down
6 changes: 3 additions & 3 deletions customs/bitcoin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bitcoin_customs::updates::{
};
use bitcoin_customs::{
process_hub_msg_task, process_tx_task, refresh_fee_task, CustomsInfo, TokenResp,
FEE_ESTIMATE_DELAY, INTERVAL_PROCESSING,
FEE_ESTIMATE_DELAY, INTERVAL_PROCESSING, INTERVAL_QUERY_HUB,
};
use bitcoin_customs::{
state::eventlog::{Event, GetEventsArg},
Expand All @@ -39,7 +39,7 @@ fn init(args: CustomArg) {
lifecycle::init::init(args);

set_timer_interval(INTERVAL_PROCESSING, process_tx_task);
set_timer_interval(INTERVAL_PROCESSING, process_hub_msg_task);
set_timer_interval(INTERVAL_QUERY_HUB, process_hub_msg_task);
set_timer_interval(FEE_ESTIMATE_DELAY, refresh_fee_task);

#[cfg(feature = "self_check")]
Expand Down Expand Up @@ -106,7 +106,7 @@ fn post_upgrade(custom_arg: Option<CustomArg>) {
lifecycle::upgrade::post_upgrade(upgrade_arg);

set_timer_interval(INTERVAL_PROCESSING, process_tx_task);
set_timer_interval(INTERVAL_PROCESSING, process_hub_msg_task);
set_timer_interval(INTERVAL_QUERY_HUB, process_hub_msg_task);
set_timer_interval(FEE_ESTIMATE_DELAY, refresh_fee_task);
}

Expand Down
2 changes: 1 addition & 1 deletion route/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub mod const_args {
pub const EVM_ADDR_BYTES_LEN: usize = 20;
pub const PERIODIC_TASK_INTERVAL: u64 = 5;
pub const BATCH_QUERY_LIMIT: u64 = 20;
pub const FETCH_HUB_TASK_INTERVAL: u64 = 10;
pub const FETCH_HUB_TASK_INTERVAL: u64 = 60;
pub const FETCH_HUB_TASK_NAME: &str = "FETCH_HUB";
pub const SEND_EVM_TASK_INTERVAL: u64 = 20;
pub const SEND_EVM_TASK_NAME: &str = "SEND_EVM";
Expand Down
2 changes: 1 addition & 1 deletion route/icp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod state;
pub mod storage;
pub mod updates;

pub const PERIODIC_TASK_INTERVAL: u64 = 5;
pub const PERIODIC_TASK_INTERVAL: u64 = 60;
pub const BATCH_QUERY_LIMIT: u64 = 20;
pub const ICRC2_WASM: &[u8] = include_bytes!("../../../ic-icrc1-ledger.wasm");
pub const ICP_TRANSFER_FEE: u64 = 10_000;
Expand Down

0 comments on commit c29711f

Please sign in to comment.