Fix TPExporter not properly closing the zipWriter

This commit is contained in:
DanB
2014-10-20 20:06:43 +02:00
parent c9f2d5d5a2
commit 771e0c49dc
2 changed files with 13 additions and 4 deletions

View File

@@ -105,10 +105,10 @@ func (self *TPExporter) Run() error {
self.removeFiles()
return err
}
if self.compress {
if err := self.zipWritter.Close(); err != nil {
return err
}
}
if self.compress {
if err := self.zipWritter.Close(); err != nil {
return err
}
}
return nil

View File

@@ -124,4 +124,13 @@ func TestTutLclLoadTariffPlanFromFolder(t *testing.T) {
t.Error(reply)
}
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time for scheduler to execute topups
}
func TestShutdown (t *testing.T) {
if !*testLocal {
return
}
exec.Command("pkill", "cgr-engine").Run() // Just to make sure another one is not running, bit brutal maybe we can fine tune it
time.Sleep(time.Duration(*waitRater) * time.Millisecond)
}