mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-17 14:57:27 +00:00
fix: address batch image ci failures
This commit is contained in:
1 parent
89edba8028
commit
aff148167c
11 files changed
+63
-51
No files matched your search
@@ -62,16 +62,6 @@ func NewBatchImageDownloadLimiter(rdb *redis.Client, cfg *config.Config) service
|
||||
}
|
||||
}
|
||||
|
||||
func newBatchImageDownloadLimiterForTest(rdb *redis.Client, maxActive int, ttl time.Duration) *batchImageDownloadLimiter {
|
||||
if maxActive <= 0 {
|
||||
maxActive = defaultBatchImageDownloadConcurrency
|
||||
}
|
||||
if ttl <= 0 {
|
||||
ttl = defaultBatchImageDownloadActiveTTL
|
||||
}
|
||||
return &batchImageDownloadLimiter{rdb: rdb, activePrefix: defaultBatchImageDownloadActivePrefix, maxActive: maxActive, ttl: ttl}
|
||||
}
|
||||
|
||||
func (l *batchImageDownloadLimiter) Acquire(ctx context.Context, userID string, kind string) (service.BatchImageDownloadPermit, error) {
|
||||
if l == nil || l.rdb == nil {
|
||||
return nil, service.ErrBatchImageDownloadLimited
|
||||
|
||||
Reference in new issue
Block a user