Skip to content

Commit 1d4e906

Browse files
committed
refactor(config): 将配置缓存次数的默认值设置为0(github #46),修正了一些注释的错误
1 parent 55d2cbb commit 1d4e906

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src-tauri/src/core/storage/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ pub struct PartialLocalConfig {
2929
pub struct LocalConfig {
3030
// 软件的版本,用于判断当前的用户是不是更新了,默认值为空
3131
version: Arc<String>,
32-
// 表示远程配置信息的存储的地址
32+
// 表示配置信息的存储目标
3333
storage_destination: Arc<StorageDestination>,
34-
// 表示远程配置信息如果要保存在本地,则其使用的配置
34+
// 表示配置信息如果要保存在本地,则其使用的配置
3535
local_save_config: Arc<LocalSaveConfig>,
36-
// 表示远程配置信息如果要保存的webdav服务器,则其使用的配置
36+
// 表示配置信息如果要保存到 WebDAV 服务器,则其使用的配置
3737
webdav_save_config: Arc<WebDAVConfig>,
3838
//onedrive_save_config: Arc<OneDriveConfig>,
39-
// 表示缓冲区的大小,保存几次后会更新到本地
39+
// 表示缓冲区的大小,保存几次后会更新到存储目标。如果为0,则每次都直接上传。
4040
save_to_local_per_update: Arc<u32>,
4141
// 欢迎页面的版本号,用于判断是否需要显示欢迎页面
4242
welcome_page_version: Arc<String>,
@@ -50,7 +50,7 @@ impl Default for LocalConfig {
5050
local_save_config: Arc::new(LocalSaveConfig::default()),
5151
webdav_save_config: Arc::new(WebDAVConfig::default()),
5252
//onedrive_save_config: Arc::new(OneDriveConfig::default()),
53-
save_to_local_per_update: Arc::new(4),
53+
save_to_local_per_update: Arc::new(0),
5454
welcome_page_version: Arc::new(String::new()),
5555
}
5656
}

src-tauri/src/modules/program_manager/config/program_ranker_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub struct PartialProgramRankerConfig {
2222
pub query_affinity_weight: Option<f64>,
2323
/// 查询亲和时间衰减常数(秒) (默认259200 = 3天)
2424
pub query_affinity_time_decay: Option<i64>,
25-
/// 查询亲和冷却时间(秒) (默认60秒)
25+
/// 查询亲和冷却时间(秒) (默认15秒)
2626
pub query_affinity_cooldown: Option<i64>,
2727
/// 短期热度衰减常数(秒) (默认10800 = 3小时)
2828
pub temporal_decay: Option<i64>,

src-tauri/src/modules/program_manager/program_ranker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl ProgramRankerInner {
6060
temporal_weight: 0.5,
6161
query_affinity_weight: 3.0,
6262
query_affinity_time_decay: 259200,
63-
query_affinity_cooldown: 60,
63+
query_affinity_cooldown: 15,
6464
temporal_decay: 10800,
6565
is_enable: true,
6666
}

src-ui/windows/settings/programs/Advanced.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
@change="(val: number) =>
350350
configStore.updateConfig({
351351
program_manager_config: {
352-
ranker: { query_affinity_cooldown: val ?? 60 }
352+
ranker: { query_affinity_cooldown: val ?? 15 }
353353
}
354354
})
355355
"

0 commit comments

Comments
 (0)