mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 04:46:24 +02:00
allow specifying multiple cache with spaces
this is necessary for the new environment variable support for config values. I don't love that allowHosts is comma separated and cache is space separated :(
This commit is contained in:
parent
d8ed21c0f4
commit
fe437a0b8c
2 changed files with 15 additions and 13 deletions
|
|
@ -122,15 +122,17 @@ func (tc *tieredCache) String() string {
|
|||
}
|
||||
|
||||
func (tc *tieredCache) Set(value string) error {
|
||||
c, err := parseCache(value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range strings.Fields(value) {
|
||||
c, err := parseCache(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if tc.Cache == nil {
|
||||
tc.Cache = c
|
||||
} else {
|
||||
tc.Cache = twotier.New(tc.Cache, c)
|
||||
if tc.Cache == nil {
|
||||
tc.Cache = c
|
||||
} else {
|
||||
tc.Cache = twotier.New(tc.Cache, c)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue