Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions worker/src/infra/meilisearch_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ async fn ensure_index(client: &Client, name: &str) -> Result<()> {
let searchable: Vec<&str> = vec![
"musicNames",
"musicNamesPinyin",
"musicNamesInitials",
"artists",
"artistsPinyin",
"artistsInitials",
"albums",
"albumsPinyin",
"albumsInitials",
"lyricText",
"platformIds_ncm",
"platformIds_qq",
"platformIds_spotify",
"platformIds_apple",
"ttmlAuthorGithub",
"ttmlAuthorGithubLogin",
];
// filterable 需覆盖后端 searchByExactID 的 filter 表达式引用的全部字段
// (含 ttmlAuthorGithubLogin,否则按 ID 搜索报 502)
let filterable: Vec<&str> = vec![
"platformIds_ncm",
"platformIds_qq",
Expand All @@ -56,6 +63,7 @@ async fn ensure_index(client: &Client, name: &str) -> Result<()> {
"artists",
"albums",
"ttmlAuthorGithub",
"ttmlAuthorGithubLogin",
];

let settings = Settings::new()
Expand Down
2 changes: 1 addition & 1 deletion worker/src/sync/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::config::GitHubConfig;
const RETRY_BASE_DELAY: std::time::Duration = std::time::Duration::from_secs(2);

/// 下载重试退避上限
const RETRY_MAX_DELAY: std::time::Duration = std::time::Duration::from_secs(60);
const RETRY_MAX_DELAY: std::time::Duration = std::time::Duration::from_secs(10);

/// 带指数退避的无限重试包装:不成功不返回,阻断流程直到下载成功
async fn with_retry<T, F, Fut>(ctx: &str, f: F) -> Result<T>
Expand Down
2 changes: 1 addition & 1 deletion worker/src/worker/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::sync_task::SyncTaskRunner;
/// 重试基础退避
const RETRY_BASE_DELAY: std::time::Duration = std::time::Duration::from_secs(5);
/// 重试退避上限(指数增长到此封顶)
const RETRY_MAX_DELAY: std::time::Duration = std::time::Duration::from_secs(60);
const RETRY_MAX_DELAY: std::time::Duration = std::time::Duration::from_secs(10);

/// 启动 RabbitMQ 消费循环
///
Expand Down