|
@@ -7,6 +7,7 @@ import (
|
|
|
"os"
|
|
"os"
|
|
|
"strings"
|
|
"strings"
|
|
|
"sync"
|
|
"sync"
|
|
|
|
|
+ "time"
|
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
@@ -17,6 +18,8 @@ import (
|
|
|
"github.com/jszwec/csvutil"
|
|
"github.com/jszwec/csvutil"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+const refreshMinutes = 60
|
|
|
|
|
+
|
|
|
type CSVProvider struct {
|
|
type CSVProvider struct {
|
|
|
*CustomProvider
|
|
*CustomProvider
|
|
|
CSVLocation string
|
|
CSVLocation string
|
|
@@ -129,6 +132,7 @@ func (c *CSVProvider) DownloadPricingData() error {
|
|
|
} else {
|
|
} else {
|
|
|
klog.Infof("[WARNING] No data received from csv")
|
|
klog.Infof("[WARNING] No data received from csv")
|
|
|
}
|
|
}
|
|
|
|
|
+ time.AfterFunc(refreshMinutes*time.Minute, func() { c.DownloadPricingData() })
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|