marcv81 commented on code in PR #11872:
URL: https://github.com/apache/inlong/pull/11872#discussion_r2107568544


##########
inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/util/id.go:
##########
@@ -29,12 +29,14 @@ var (
 )
 
 func init() {
+       var id uint32 = 0
+
+       // Generate the ID from an IP if possible.
        ip, err := GetOneIP()
-       if err != nil {
-               log.Fatal(err)

Review Comment:
   Note: I used `Lock` instead of `Once`. This way `initSnowflake` has a chance 
to succeed if it previously failed, instead of permanently remaining in an 
error state. Maybe this is helpful if the program using the SDK started while 
the network was down? Or maybe this is overkill :) Please let me know what you 
think.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to