Skip to content

Commit

Permalink
init runtime after
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Jul 24, 2024
1 parent 9c4f89a commit 0e5c4f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
1 change: 1 addition & 0 deletions pkg/runtime/kclvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func init() {
installKclArtifact()
}
g_KclvmRoot = findKclvmRoot()
_ = GetRuntime()
}

func installKclArtifact() {
Expand Down
19 changes: 0 additions & 19 deletions pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit 0e5c4f9

Please sign in to comment.