Skip to content

Commit

Permalink
fix: runtime init panic
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 00f47a8 commit bd43bf5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ func (p *Runtime) Start() {
p.mu.Lock()
defer p.mu.Unlock()

// 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 bd43bf5

Please sign in to comment.