summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorEiichiro Watanabe <a16tochjp@gmail.com>2018-11-12 17:12:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-12 21:32:07 +0900
commit0eb3dcede55433facbeab23e753d3ab991b5e33b (patch)
treea34744934fe0780cb4008a9481c4e7237a5dfd17 /pkg
parent4cc7a81e8f5ae3c6584f26a1d9300e0522fdab7d (diff)
Fix intervals for MRT
Diffstat (limited to 'pkg')
-rw-r--r--pkg/server/mrt.go10
-rw-r--r--pkg/server/server.go3
2 files changed, 7 insertions, 6 deletions
diff --git a/pkg/server/mrt.go b/pkg/server/mrt.go
index b4fe30b5..773f0ea5 100644
--- a/pkg/server/mrt.go
+++ b/pkg/server/mrt.go
@@ -282,15 +282,15 @@ func (m *mrtWriter) loop() error {
}
}
-func mrtFileOpen(filename string, interval uint64) (*os.File, error) {
+func mrtFileOpen(filename string, rInterval uint64) (*os.File, error) {
realname := filename
- if interval != 0 {
+ if rInterval != 0 {
realname = time.Now().Format(filename)
}
log.WithFields(log.Fields{
- "Topic": "mrt",
- "Filename": realname,
- "Dump Interval": interval,
+ "Topic": "mrt",
+ "Filename": realname,
+ "RotationInterval": rInterval,
}).Debug("Setting new MRT destination file")
i := len(realname)
diff --git a/pkg/server/server.go b/pkg/server/server.go
index 4fd4aa25..68a43c0e 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -3280,7 +3280,8 @@ func (s *BgpServer) SetPolicyAssignment(ctx context.Context, r *api.SetPolicyAss
func (s *BgpServer) EnableMrt(ctx context.Context, r *api.EnableMrtRequest) error {
return s.mgmtOperation(func() error {
return s.mrtManager.enable(&config.MrtConfig{
- RotationInterval: r.Interval,
+ DumpInterval: r.DumpInterval,
+ RotationInterval: r.RotationInterval,
DumpType: config.IntToMrtTypeMap[int(r.DumpType)],
FileName: r.Filename,
})