fix: Fix Bug related issues with OpenIM actions PR (#921)

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add test changelog file

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong
2023-08-23 16:45:52 +08:00
committed by GitHub
parent 73c4b68052
commit b2ea4ce2a3
100 changed files with 939 additions and 832 deletions
+1 -2
View File
@@ -58,6 +58,5 @@ func main() {
// openim-rpc-user
switch module {
case "openim-api":
}
}
+8 -8
View File
@@ -26,8 +26,8 @@ import (
// profiling configuration variables
var (
profileName string = "none" // Name of the profile to capture.
profileOutput string = "profile.pprof" // File to write the profile data.
profileName string = "none" // Name of the profile to capture.
profileOutput string = "profile.pprof" // File to write the profile data.
)
// addProfilingFlags registers profiling related flags to the given FlagSet.
@@ -41,8 +41,8 @@ func addProfilingFlags(flags *pflag.FlagSet) {
flags.StringVar(&profileOutput, "profile-output", "profile.pprof", "File to write the profile data")
}
// initProfiling sets up profiling based on the user's choice.
// If 'cpu' is selected, it starts the CPU profile. For block and mutex profiles,
// initProfiling sets up profiling based on the user's choice.
// If 'cpu' is selected, it starts the CPU profile. For block and mutex profiles,
// sampling rates are set up.
func initProfiling() error {
switch profileName {
@@ -55,10 +55,10 @@ func initProfiling() error {
}
return pprof.StartCPUProfile(f)
case "block":
runtime.SetBlockProfileRate(1) // Sampling every block event
runtime.SetBlockProfileRate(1) // Sampling every block event
return nil
case "mutex":
runtime.SetMutexProfileFraction(1) // Sampling every mutex event
runtime.SetMutexProfileFraction(1) // Sampling every mutex event
return nil
default:
if profile := pprof.Lookup(profileName); profile == nil {
@@ -68,8 +68,8 @@ func initProfiling() error {
}
}
// flushProfiling writes the profiling data to the specified file.
// For heap profiles, it runs the GC before capturing the data.
// flushProfiling writes the profiling data to the specified file.
// For heap profiles, it runs the GC before capturing the data.
// It stops the CPU profile if it was started.
func flushProfiling() error {
switch profileName {