mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-03-30 04:05:29 +00:00
fix: respect preconfigured usage log batch channels
This commit is contained in:
@@ -377,7 +377,7 @@ func (r *usageLogRepository) createBatched(ctx context.Context, log *service.Usa
|
||||
}
|
||||
|
||||
func (r *usageLogRepository) ensureCreateBatcher() {
|
||||
if r == nil || r.db == nil {
|
||||
if r == nil || r.db == nil || r.createBatchCh != nil {
|
||||
return
|
||||
}
|
||||
r.createBatchOnce.Do(func() {
|
||||
@@ -387,7 +387,7 @@ func (r *usageLogRepository) ensureCreateBatcher() {
|
||||
}
|
||||
|
||||
func (r *usageLogRepository) ensureBestEffortBatcher() {
|
||||
if r == nil || r.db == nil {
|
||||
if r == nil || r.db == nil || r.bestEffortBatchCh != nil {
|
||||
return
|
||||
}
|
||||
r.bestEffortBatchOnce.Do(func() {
|
||||
|
||||
Reference in New Issue
Block a user