Skip to content
Merged
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
18 changes: 9 additions & 9 deletions service/src/teeracle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ pub(crate) fn start_interval_market_update<E: TeeracleApi>(
enclave_api: &E,
tokio_handle: &Handle,
) {
let updates_to_run = || {
execute_market_update(api, enclave_api, tokio_handle);
execute_weather_update(api, enclave_api, tokio_handle);
};
info!("Teeracle will update now");
updates_to_run();

let interval = maybe_interval.unwrap_or(DEFAULT_MARKET_DATA_UPDATE_INTERVAL);
info!("Starting teeracle interval for oracle update, interval of {:?}", interval);

schedule_on_repeating_intervals(
|| {
execute_update_market(api, enclave_api, tokio_handle);
execute_weather_update(api, enclave_api, tokio_handle);
},
interval,
);
schedule_on_repeating_intervals(updates_to_run, interval);
}

fn execute_weather_update<E: TeeracleApi>(
Expand Down Expand Up @@ -98,7 +98,7 @@ fn execute_weather_update<E: TeeracleApi>(
});
}

fn execute_update_market<E: TeeracleApi>(
fn execute_market_update<E: TeeracleApi>(
node_api: &ParentchainApi,
enclave: &E,
tokio_handle: &Handle,
Expand Down