simplify: 移除 leader lock,单实例无需分布式锁

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
guoyongchang
2026-03-05 16:31:27 +08:00
parent 9a8dacc514
commit 817a491087
6 changed files with 4 additions and 119 deletions

View File

@@ -59,10 +59,3 @@ type ScheduledTestResultRepository interface {
ListByPlanID(ctx context.Context, planID int64, limit int) ([]*ScheduledTestResult, error)
PruneOldResults(ctx context.Context, planID int64, keepCount int) error
}
// LeaderLocker provides distributed leader election for background runners.
// TryAcquire attempts to acquire a named lock and returns a release function
// and true if successful, or nil and false if the lock is held by another instance.
type LeaderLocker interface {
TryAcquire(ctx context.Context, key string, ttl time.Duration) (release func(), ok bool)
}