plugin/route53: remove amazon intialization from init (#3348)
Don't perform this code in the init, this allocated 1 megabyte of memory even if you don't use the plugin. Looks to be only there for testing, adding a comment to reflect that. Fixes #3342 Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
8fde7407d9
commit
aa96d6b443
2 changed files with 8 additions and 14 deletions
|
@ -24,20 +24,14 @@ import (
|
|||
|
||||
var log = clog.NewWithPlugin("route53")
|
||||
|
||||
func init() {
|
||||
plugin.Register("route53",
|
||||
func(c *caddy.Controller) error {
|
||||
f := func(credential *credentials.Credentials) route53iface.Route53API {
|
||||
return route53.New(session.Must(session.NewSession(&aws.Config{
|
||||
Credentials: credential,
|
||||
})))
|
||||
}
|
||||
return setup(c, f)
|
||||
},
|
||||
)
|
||||
func init() { plugin.Register("route53", setup) }
|
||||
|
||||
// exposed for testing
|
||||
var f = func(credential *credentials.Credentials) route53iface.Route53API {
|
||||
return route53.New(session.Must(session.NewSession(&aws.Config{Credentials: credential})))
|
||||
}
|
||||
|
||||
func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Route53API) error {
|
||||
func setup(c *caddy.Controller) error {
|
||||
for c.Next() {
|
||||
keyPairs := map[string]struct{}{}
|
||||
keys := map[string][]string{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue