You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errs=append(errs, fmt.Errorf("%s: in_memory_cache must be 0 for unbounded caches. Got %d", section, cfg.TTL))
415
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.ttl_seconds is not supported for unbounded caches. Got %d", section, cfg.TTL))
400
416
}
401
-
ifcfg.RequestCacheSize!=0 {
402
-
errs=append(errs, fmt.Errorf("%s: in_memory_cache.request_cache_size_bytes must be 0 for unbounded caches. Got %d", section, cfg.RequestCacheSize))
403
-
}
404
-
ifcfg.ImpCacheSize!=0 {
405
-
errs=append(errs, fmt.Errorf("%s: in_memory_cache.imp_cache_size_bytes must be 0 for unbounded caches. Got %d", section, cfg.ImpCacheSize))
417
+
ifdataType==AccountDataType {
418
+
// single cache
419
+
ifcfg.Size!=0 {
420
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.size_bytes is not supported for unbounded caches. Got %d", section, cfg.Size))
421
+
}
422
+
} else {
423
+
// dual (request and imp) caches
424
+
ifcfg.RequestCacheSize!=0 {
425
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.request_cache_size_bytes is not supported for unbounded caches. Got %d", section, cfg.RequestCacheSize))
426
+
}
427
+
ifcfg.ImpCacheSize!=0 {
428
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.imp_cache_size_bytes is not supported for unbounded caches. Got %d", section, cfg.ImpCacheSize))
429
+
}
406
430
}
407
431
case"lru":
408
-
ifcfg.RequestCacheSize<=0 {
409
-
errs=append(errs, fmt.Errorf("%s: in_memory_cache.request_cache_size_bytes must be >= 0 when in_memory_cache.type=lru. Got %d", section, cfg.RequestCacheSize))
410
-
}
411
-
ifcfg.ImpCacheSize<=0 {
412
-
errs=append(errs, fmt.Errorf("%s: in_memory_cache.imp_cache_size_bytes must be >= 0 when in_memory_cache.type=lru. Got %d", section, cfg.ImpCacheSize))
432
+
ifdataType==AccountDataType {
433
+
// single cache
434
+
ifcfg.Size<=0 {
435
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.size_bytes must be >= 0 when in_memory_cache.type=lru. Got %d", section, cfg.Size))
436
+
}
437
+
ifcfg.RequestCacheSize>0||cfg.ImpCacheSize>0 {
438
+
glog.Warningf("%s: in_memory_cache.request_cache_size_bytes and imp_cache_size_bytes do not apply to this section and will be ignored", section)
439
+
}
440
+
} else {
441
+
// dual (request and imp) caches
442
+
ifcfg.RequestCacheSize<=0 {
443
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.request_cache_size_bytes must be >= 0 when in_memory_cache.type=lru. Got %d", section, cfg.RequestCacheSize))
444
+
}
445
+
ifcfg.ImpCacheSize<=0 {
446
+
errs=append(errs, fmt.Errorf("%s: in_memory_cache.imp_cache_size_bytes must be >= 0 when in_memory_cache.type=lru. Got %d", section, cfg.ImpCacheSize))
447
+
}
448
+
ifcfg.Size>0 {
449
+
glog.Warningf("%s: in_memory_cache.size_bytes does not apply in this section and will be ignored", section)
450
+
}
413
451
}
414
452
default:
415
453
errs=append(errs, fmt.Errorf("%s: in_memory_cache.type %s is invalid", section, cfg.Type))
0 commit comments