From c37f55af74ace1b6fcc74efb69aafa62a1cd5bda Mon Sep 17 00:00:00 2001 From: Marina-Sakai Date: Mon, 10 Feb 2025 11:39:13 +0800 Subject: [PATCH] chore: add warning comments --- pkg/generic/pbidl_provider.go | 4 ++++ pkg/generic/thriftidl_provider.go | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/generic/pbidl_provider.go b/pkg/generic/pbidl_provider.go index 32651c8007..4521d3b518 100644 --- a/pkg/generic/pbidl_provider.go +++ b/pkg/generic/pbidl_provider.go @@ -56,6 +56,8 @@ func NewPbContentProvider(main string, includes map[string]string) (PbDescriptor return p, nil } +// UpdateIDL updates idl +// NOTE: Since an IDL update is asynchronous, it may not be applied immediately, potentially causing a temporary data inconsistency. func (p *PbContentProvider) UpdateIDL(main string, includes map[string]string) error { sd, err := parseProto(main, includes) if err != nil { @@ -140,6 +142,8 @@ func NewPbContentProviderWithDynamicGo(ctx context.Context, options dproto.Optio return p, nil } +// UpdateIDL updates idl +// NOTE: Since an IDL update is asynchronous, it may not be applied immediately, potentially causing a temporary data inconsistency. func (p *PbFileProviderWithDynamicGo) UpdateIDL(ctx context.Context, options dproto.Options, mainPath, mainContent string, includes map[string]string) error { sd, err := options.NewDesccriptorFromContent(ctx, mainPath, mainContent, includes) if err != nil { diff --git a/pkg/generic/thriftidl_provider.go b/pkg/generic/thriftidl_provider.go index fc89e333ba..82cd96d461 100644 --- a/pkg/generic/thriftidl_provider.go +++ b/pkg/generic/thriftidl_provider.go @@ -205,7 +205,8 @@ func NewThriftContentProviderWithDynamicGo(main string, includes map[string]stri return p, nil } -// UpdateIDL ... +// UpdateIDL updates idl +// NOTE: Since an IDL update is asynchronous, it may not be applied immediately, potentially causing a temporary data inconsistency. func (p *ThriftContentProvider) UpdateIDL(main string, includes map[string]string) error { var svc *descriptor.ServiceDescriptor tree, err := ParseContent(defaultMainIDLPath, main, includes, false) @@ -388,7 +389,8 @@ func NewThriftContentWithAbsIncludePathProviderWithDynamicGo(mainIDLPath string, return p, nil } -// UpdateIDL update idl by given args +// UpdateIDL updates idl +// NOTE: Since an IDL update is asynchronous, it may not be applied immediately, potentially causing a temporary data inconsistency. func (p *ThriftContentWithAbsIncludePathProvider) UpdateIDL(mainIDLPath string, includes map[string]string) error { mainIDLContent, ok := includes[mainIDLPath] if !ok {