Skip to content

Commit

Permalink
fixed a few crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jan 24, 2025
1 parent 5629942 commit 0d04ff6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/baremetal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Client struct {
func NewClient() *Client {
cl := &Client{}
cl.Host = "localhost:8585"
cl.Timeout = 20 * time.Second
cl.Timeout = 120 * time.Second
return cl
}

Expand Down
6 changes: 5 additions & 1 deletion examples/baremetal/cmd/baremetal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ func (s *server) JobStatus(_ context.Context, in *pb.JobIDList) (*pb.JobList, er
func (s *server) CancelJobs(_ context.Context, in *pb.JobIDList) (*pb.Error, error) {
slog.Info("CancelJobs")
err := s.bm.CancelJobs(baremetal.JobIDsFromPB(in.JobID)...)
return &pb.Error{Error: err.Error()}, nil
estr := ""
if err != nil {
estr = err.Error()
}
return &pb.Error{Error: estr}, nil
}

// FetchResults gets job results back from server for given job id(s).
Expand Down
23 changes: 13 additions & 10 deletions examples/simmer/jobs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 13 additions & 10 deletions examples/simmer/jobs.goal
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,19 @@ func (sr *Simmer) JobStatus(jid string, force bool) {
if err != nil {
core.ErrorSnackbar(sr, err)
} else {
job := jobs[0]
sstat = job.Status.String()
goalib.WriteFile("job.status", sstat)
goalib.WriteFile("job.squeue", sstat)
if !job.Start.IsZero() {
goalib.WriteFile("job.start", job.Start.Format(sr.Config.TimeFormat))
}
if !job.End.IsZero() {
goalib.WriteFile("job.end", job.End.Format(sr.Config.TimeFormat))
if len(jobs) == 1 {
job := jobs[0]
sstat = job.Status.String()
goalib.WriteFile("job.status", sstat)
goalib.WriteFile("job.squeue", sstat)
if !job.Start.IsZero() {
goalib.WriteFile("job.start", job.Start.Format(sr.Config.TimeFormat))
}
if !job.End.IsZero() {
goalib.WriteFile("job.end", job.End.Format(sr.Config.TimeFormat))
}
// fmt.Println(jid, sstat)
}
// fmt.Println(jid, sstat)
}
@0
if sstat == "Running" {
Expand Down Expand Up @@ -288,6 +290,7 @@ func (sr *Simmer) GetMeta(jid string) {
func (sr *Simmer) Status() { //types:add
@0
sr.UpdateFiles()
sr.Jobs()
dpath := filepath.Join(sr.DataRoot, "jobs")
ds := fsx.Dirs(dpath)
for _, jid := range ds {
Expand Down

0 comments on commit 0d04ff6

Please sign in to comment.