mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-05 16:46:58 +08:00
'传入外部版本号'
This commit is contained in:
7
main.go
7
main.go
@@ -50,7 +50,7 @@ func init() {
|
||||
}
|
||||
|
||||
// Run 启动Monibuca引擎,传入总的Context,可用于关闭所有
|
||||
func Run(ctx context.Context, configFile string) (err error) {
|
||||
func Run(ctx context.Context, configFile, version string) (err error) {
|
||||
SysInfo.StartTime = time.Now()
|
||||
SysInfo.Version = Engine.Version
|
||||
Engine.Context = ctx
|
||||
@@ -93,7 +93,10 @@ func Run(ctx context.Context, configFile string) (err error) {
|
||||
contentBuf := bytes.NewBuffer(nil)
|
||||
req, _ := http.NewRequestWithContext(ctx, http.MethodPost, "https://logs-01.loggly.com/inputs/758a662d-f630-40cb-95ed-2502a5e9c872/tag/monibuca/", nil)
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
content := fmt.Sprintf(`{"uuid":"%s","version":"%s","os":"%s","arch":"%s"`, UUID, Engine.Version, runtime.GOOS, runtime.GOARCH)
|
||||
if version == "" {
|
||||
version = Engine.Version
|
||||
}
|
||||
content := fmt.Sprintf(`{"uuid":"%s","version":"%s","os":"%s","arch":"%s"`, UUID, version, runtime.GOOS, runtime.GOARCH)
|
||||
if EngineConfig.Secret != "" {
|
||||
EngineConfig.OnEvent(ctx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user