chore: release v0.1.10 with event ID generation and cache fixes

This commit is contained in:
ysq
2025-08-05 14:40:07 +08:00
parent c0af0bf738
commit f700481f1f
6 changed files with 23 additions and 15 deletions
+9 -7
View File
@@ -271,13 +271,15 @@ pub trait EventParser: Send + Sync {
program_received_time_ms: i64,
bot_wallet: Option<Pubkey>,
) -> Result<Vec<Box<dyn UnifiedEvent>>> {
// 生成缓存键
let cache_key = format!("{}_{}_{}", signature, slot.unwrap_or(0), program_received_time_ms);
// TODO: bug - 待优化
// // 生成缓存键
// let cache_key = format!("{}_{}_{}", signature, slot.unwrap_or(0), program_received_time_ms);
// 尝试从缓存获取
if let Some(cached_events) = PARSE_CACHE.get(&cache_key).await {
return Ok(cached_events);
}
// // 尝试从缓存获取
// if let Some(cached_events) = PARSE_CACHE.get(&cache_key).await {
// return Ok(cached_events);
// }
let transaction = tx.transaction;
// 检查交易元数据
@@ -443,7 +445,7 @@ pub trait EventParser: Send + Sync {
let result = self.process_events(instruction_events, bot_wallet);
// 缓存结果
PARSE_CACHE.set(cache_key, result.clone()).await;
// PARSE_CACHE.set(cache_key, result.clone()).await;
Ok(result)
}