Skip to content

Commit

Permalink
optimize: add global descriptor release api
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyJavaBean committed Dec 20, 2024
1 parent d74a745 commit 3cd70a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions thrift_reflection/descriptor_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ func RegisterAST(ast *parser.Thrift) (*GlobalDescriptor, *FileDescriptor) {
return gd, fd
}

// ReleaseGlobalDescriptor release the global descriptor
func ReleaseGlobalDescriptor(gdUUID string) {
lock.Lock()
delete(globalDescriptorMap, gdUUID)
defer lock.Unlock()
}

func generateShortUUID() string {
uuid := make([]byte, 4)
_, _ = rand.Read(uuid)
Expand Down

0 comments on commit 3cd70a7

Please sign in to comment.