From 0e5c4f90a6d675efe177a71ac4ae97cd41e638cb Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 24 Jul 2024 12:50:23 +0800 Subject: [PATCH] init runtime after Signed-off-by: peefy --- pkg/runtime/kclvm.go | 1 + pkg/runtime/runtime.go | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/pkg/runtime/kclvm.go b/pkg/runtime/kclvm.go index b9cfbc06..74fc06be 100644 --- a/pkg/runtime/kclvm.go +++ b/pkg/runtime/kclvm.go @@ -24,6 +24,7 @@ func init() { installKclArtifact() } g_KclvmRoot = findKclvmRoot() + _ = GetRuntime() } func installKclArtifact() { diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index dc95a28b..1ba2bc2a 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -47,25 +47,6 @@ func (p *Runtime) Start() { p.mu.Lock() defer p.mu.Unlock() - // Try to get the runtime - // if !env.GetDisableInstallArtifact() { - // // Get the install lib path. - // path := path.LibPath() - // err := os.MkdirAll(path, 0777) - // if err != nil { - // logger.GetLogger().Warningf("install kclvm failed: %s", err.Error()) - // } - // // Acquire a file lock for process synchronization - // lockPath := filepath.Join(path, "init.lock") - // fileLock := flock.New(lockPath) - // lockCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - // defer cancel() - // locked, err := fileLock.TryLockContext(lockCtx, time.Second) - // if err == nil && locked { - // defer fileLock.Unlock() - // } - // } - for i, proc := range p.procs { if proc == nil || proc.IsExited() { proc, err := createProcess(p.exe, p.args...)