增加商品多规格探测缓存

This commit is contained in:
Christ committed 2026-08-15 16:08:37 +08:00
1 parent 8dbe2d6616
commit 6bc29829ba
4 files changed
+106 -1

No files matched your search

+5
View File
@@ -85,6 +85,10 @@ type Server struct {
reconciliation *reconciliation.Service
// transactionRepository 提供统一事务执行所需的最小持久化能力。
transactionRepository transactionRepository
// itemSpecCacheMu 保护商品多规格探测缓存。
itemSpecCacheMu sync.Mutex
// itemSpecCache 保存短期商品多规格探测结果,减少重复远端请求。
itemSpecCache map[string]itemSpecCacheEntry
publishMu sync.Mutex
publishCancels map[string]publishBatchWorker
@@ -154,6 +158,7 @@ func New(store *db.Store, manager *account.Manager, secure bool, webDir, addr st
qrPersisted: make(map[string]qrLoginPersistence),
qrOwners: make(map[string]qrLoginOwner),
loginLimiter: newLoginFailureLimiter(),
itemSpecCache: make(map[string]itemSpecCacheEntry),
}
// option 表示当前遍历过程中的option
for _, option := range options {