[Good first issue] 让 K 线缓存区分请求的起止时间

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, electron, react, typescript
Domain
backend, data

Research direction

Start with the K-line cache key in packages/shared/src/agent/market-data-service.ts around lines 139-151, which currently builds the key from symbol, period and count only, leaving start and end out. Then read the cache and in-flight request handling at lines 245-278 and the K-line options in packages/longbridge-tools/src/tools/kline.ts. Done means sequential and concurrent calls with different date ranges each fetch their own data, same-range repeats still reuse the cache, and both cases have offline tests using a mock fetch function.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted

最小复现

使用带模拟取数函数的 MarketDataService。对 AAPL.US 发起两个周期、条数相同但日期范围不同的 getKline() 请求。模拟取数函数以各请求的 start 作为返回时间。顺序调用时第二个范围收到第一个范围的数据,两个请求并发时也只调用了一次取数函数。当前缓存键包含标的、周期和条数,start 与 end 未参与计算。

复验使用 Windows、Bun 1.4.2 和 main 的 579395e。

验收标准

  • 同标的、同周期且日期范围不同的请求分别取数,顺序和并发调用都返回各自范围的数据。
  • 同一范围的重复请求继续复用缓存或在途请求。用一个模拟取数函数补上两类离线回归。

源码起点

认领前可先说明准备完成的范围,再评论 /claim。参与方式见 #7。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
8h 8m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.