Skip to content

Commit

Permalink
bugfix: update the process proceeds to the next step when InstallDepe…
Browse files Browse the repository at this point in the history
…ndencies failed (#67) (#68)
  • Loading branch information
hwzhuhao authored Sep 10, 2024
1 parent d851649 commit fe35e52
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,27 @@ func initDependencies() {
go func() {
ticker := time.NewTicker(30 * time.Minute)
for range ticker.C {
log.Info("updating python dependencies...")
err := python.InstallDependencies(dependencies.PythonRequirements)
if err != nil {
log.Error("failed to update python dependencies: %v", err)
if err:=updatePythonDependencies(dependencies);err!=nil{
log.Error("Failed to update Python dependencies: %v", err)
}
err = python.PreparePythonDependenciesEnv()
if err != nil {
log.Error("failed to update python dependencies sandbox: %v", err)
}
log.Info("python dependencies updated")
}
}()
}

func updatePythonDependencies(dependencies static.RunnerDependencies) error {
log.Info("Updating Python dependencies...")
if err := python.InstallDependencies(dependencies.PythonRequirements); err != nil {
log.Error("Failed to install Python dependencies: %v", err)
return err
}
if err := python.PreparePythonDependenciesEnv(); err != nil {
log.Error("Failed to prepare Python dependencies environment: %v", err)
return err
}
log.Info("Python dependencies updated successfully.")
return nil
}

func Run() {
// init config
initConfig()
Expand Down

0 comments on commit fe35e52

Please sign in to comment.