Merge pull request #41513 from phaas/patch-1

Fix gcplogs memory/connection leak
This commit is contained in:
Sebastiaan van Stijn 2020-10-01 08:50:36 +02:00 committed by GitHub
commit 7ed56de151
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,7 @@ func init() {
}
type gcplogs struct {
client *logging.Client
logger *logging.Logger
instance *instanceInfo
container *containerInfo
@ -170,6 +171,7 @@ func New(info logger.Info) (logger.Logger, error) {
}
l := &gcplogs{
client: c,
logger: lg,
container: &containerInfo{
Name: info.ContainerName,
@ -237,7 +239,7 @@ func (l *gcplogs) Log(m *logger.Message) error {
func (l *gcplogs) Close() error {
l.logger.Flush()
return nil
return l.client.Close()
}
func (l *gcplogs) Name() string {