Use HashMap::from in scheduler module

This commit is contained in:
silverpill 2022-12-15 17:43:30 +00:00
parent 533cd81aa6
commit d3bad8d38d

View file

@ -127,12 +127,13 @@ pub fn run(
db_pool: DbPool, db_pool: DbPool,
) -> () { ) -> () {
tokio::spawn(async move { tokio::spawn(async move {
let mut scheduler_state = HashMap::new(); let mut scheduler_state = HashMap::from([
scheduler_state.insert(Task::NftMonitor, None); (Task::NftMonitor, None),
scheduler_state.insert(Task::EthereumSubscriptionMonitor, None); (Task::EthereumSubscriptionMonitor, None),
scheduler_state.insert(Task::SubscriptionExpirationMonitor, None); (Task::SubscriptionExpirationMonitor, None),
scheduler_state.insert(Task::MoneroPaymentMonitor, None); (Task::MoneroPaymentMonitor, None),
scheduler_state.insert(Task::IncomingActivityQueue, None); (Task::IncomingActivityQueue, None),
]);
let mut interval = tokio::time::interval(Duration::from_secs(5)); let mut interval = tokio::time::interval(Duration::from_secs(5));
let mut token_waitlist_map: HashMap<Uuid, DateTime<Utc>> = HashMap::new(); let mut token_waitlist_map: HashMap<Uuid, DateTime<Utc>> = HashMap::new();