stormasm/redsled

write a redis switch

Opened this issue · 0 comments

currently I am hacking the switching...

from top_n_items_redis.rs

    // Eventually this will be replaced by the start_switch
    // Our first model will be start_switch_redis
    // In the future it could be start_switch_sled
    // Depending on where you are getting your data from

    let start_id_redis: RedisResult<Option<u32>> = get_redis_key("hn-story-start".to_string());
    let start_id = start_id_redis.unwrap().unwrap();

    // Instead of getting the start_id from redis
    // get it from here
    // let start_id = 21698868;

    // If the above 2 locations are None then grab
    // it from the hackernews api

    // let start_id = api.get_max_item_id().unwrap();

    println!("start id = {}", start_id);

    let item_ids = top_n_items(10000, start_id);