防锈柴油上没有缓存

时间:2020-05-20 08:29:33

标签: caching rust rust-diesel

我正在使用MySQL作为数据库,并使用柴油来检索数据。数据从多个端点每秒更新一次。问题是在使用柴油机来检索数据时,我得到的结果已过时(可能是由于柴油机侧的缓存)。 MySQL以SET GLOBAL query_cache_size = 0运行,因此数据库服务器端没有活动的缓存。

这是我的代码中检索数据的部分:

pub struct Weather {
    pub id: u32,
    pub temperature: f32,
    pub datetime: NaiveDateTime,
}

pub fn {
    let timewindow = ... // A timewindow I set
    let results = weather.filter(datetime.ge(timewindow)).load::<Weather>(&db).unwrap();
    println("{:?}", results)
}

您知道如何停用柴油上的缓存吗?

0 个答案:

没有答案