Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Add cleanup func for returning dgo client to pool#93

Merged
matthewmcneely merged 1 commit intomainfrom
matthewmcneely/add-cleanup-func-for-dgraph-client
May 7, 2025
Merged

Add cleanup func for returning dgo client to pool#93
matthewmcneely merged 1 commit intomainfrom
matthewmcneely/add-cleanup-func-for-dgraph-client

Conversation

@matthewmcneely
Copy link
Contributor

Description

This PR adds a cleanup func to the return signature of client.DgraphClient. Needed to properly return the dgo client to the pool. This doesn't effect file-based instances, just those that work with remote clusters.

Checklist

  • Code compiles correctly and linting passes locally
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

@matthewmcneely matthewmcneely requested review from a team and Copilot May 7, 2025 01:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the DgraphClient function to return a cleanup function along with the client, enabling proper resource management for remote cluster clients.

  • In query_test.go, the test is updated to receive and defer the cleanup function.
  • In client.go, the DgraphClient method is refactored to provide a cleanup function that returns the client to the pool.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
query_test.go Updated to use the new DgraphClient signature and defer the cleanup call.
client.go Modified DgraphClient to return a cleanup function along with the client.

@matthewmcneely matthewmcneely enabled auto-merge (squash) May 7, 2025 01:44
@matthewmcneely matthewmcneely merged commit a0efabf into main May 7, 2025
7 checks passed
@matthewmcneely matthewmcneely deleted the matthewmcneely/add-cleanup-func-for-dgraph-client branch May 7, 2025 02:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants