appengine: added closure of client to avoid memory spike
@@ -34,6 +34,7 @@ func createTask(projectID, locationID, queueID, message string) (*taskspb.Task,
if err != nil {
return nil, fmt.Errorf("NewClient: %v", err)
}
+ defer client.Close()
// Build the Task queue path.
queuePath := fmt.Sprintf("projects/%s/locations/%s/queues/%s", projectID, locationID, queueID)
