@@ -18,6 +18,7 @@ import (
18
18
"github.com/chef/automate/components/pg-sidecar-service/pkg/pgw"
19
19
"github.com/chef/automate/lib/grpc/health"
20
20
"github.com/chef/automate/lib/grpc/secureconn"
21
+ "github.com/chef/automate/lib/io/fileutils"
21
22
"github.com/chef/automate/lib/platform"
22
23
"github.com/chef/automate/lib/tracing"
23
24
"github.com/chef/automate/lib/version"
@@ -126,7 +127,7 @@ func (p *PGSidecarServer) SetPublicSchemaRole(ctx context.Context, req *api.SetP
126
127
if err != nil {
127
128
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
128
129
}
129
- defer client . Close ( )
130
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
130
131
131
132
proc , err := p .queueSerialProcedure (
132
133
ctx ,
@@ -149,7 +150,7 @@ func (p *PGSidecarServer) AlterRole(ctx context.Context, req *api.AlterRoleReq)
149
150
if err != nil {
150
151
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
151
152
}
152
- defer client . Close ( )
153
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
153
154
154
155
query := pgw .NewAlterRoleQuery ()
155
156
b , err = json .Marshal (req .With )
@@ -188,7 +189,7 @@ func (p *PGSidecarServer) CreateDB(ctx context.Context, req *api.CreateDBReq) (*
188
189
if err != nil {
189
190
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
190
191
}
191
- defer client . Close ( )
192
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
192
193
193
194
proc , err := p .queueSerialProcedure (
194
195
ctx ,
@@ -213,7 +214,7 @@ func (p *PGSidecarServer) CreateExtension(ctx context.Context, req *api.CreateEx
213
214
if err != nil {
214
215
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
215
216
}
216
- defer client . Close ( )
217
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
217
218
218
219
proc , err := p .queueSerialProcedure (
219
220
ctx ,
@@ -235,7 +236,7 @@ func (p *PGSidecarServer) DeploySqitch(ctx context.Context, req *api.DeploySqitc
235
236
if err != nil {
236
237
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
237
238
}
238
- defer client . Close ( )
239
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
239
240
240
241
proc , err := p .queueSerialProcedure (
241
242
ctx ,
@@ -257,7 +258,7 @@ func (p *PGSidecarServer) MigrateTables(ctx context.Context, req *api.MigrateTab
257
258
if err != nil {
258
259
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
259
260
}
260
- defer client . Close ( )
261
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
261
262
262
263
proc , err := p .queueSerialProcedure (
263
264
ctx ,
@@ -307,7 +308,7 @@ func (p *PGSidecarServer) DropTables(ctx context.Context, req *api.DropTablesReq
307
308
if err != nil {
308
309
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
309
310
}
310
- defer client . Close ( )
311
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
311
312
312
313
query := pgw .NewDropTablesQuery ()
313
314
query .Tables = req .Tables
@@ -335,7 +336,7 @@ func (p *PGSidecarServer) RenameDB(ctx context.Context, req *api.RenameDBReq) (*
335
336
if err != nil {
336
337
return res , status .New (codes .FailedPrecondition , err .Error ()).Err ()
337
338
}
338
- defer client . Close ( )
339
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
339
340
340
341
proc , err := p .queueSerialProcedure (
341
342
ctx ,
@@ -356,7 +357,7 @@ func (p *PGSidecarServer) Start() error {
356
357
if err != nil {
357
358
return err
358
359
}
359
- defer client . Close ( )
360
+ defer fileutils . LogClose ( client , logrus . StandardLogger (), "failed to close client" )
360
361
361
362
// Start the serial procedure runner
362
363
p .spr = pgw .NewSerialProcedureRunner ()
0 commit comments