MCPcopy Index your code
hub / github.com/coder/coder / checkRunningBuild

Method checkRunningBuild

coderd/wsbuilder/wsbuilder.go:1416–1434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1414}
1415
1416func (b *Builder) checkRunningBuild() error {
1417 job, err := b.getLastBuildJob()
1418 if xerrors.Is(err, sql.ErrNoRows) {
1419 // no prior build, so it can't be running!
1420 return nil
1421 }
1422 if err != nil {
1423 return BuildError{http.StatusInternalServerError, "failed to fetch prior build", err}
1424 }
1425 if codersdk.ProvisionerJobStatus(job.JobStatus).Active() {
1426 msg := "A workspace build is already active."
1427 return BuildError{
1428 http.StatusConflict,
1429 msg,
1430 xerrors.New(msg),
1431 }
1432 }
1433 return nil
1434}
1435
1436func (b *Builder) usingDynamicParameters() bool {
1437 tpl, err := b.getTemplate()

Callers 1

buildTxMethod · 0.95

Calls 5

getLastBuildJobMethod · 0.95
ProvisionerJobStatusTypeAlias · 0.92
ActiveMethod · 0.80
NewMethod · 0.65
IsMethod · 0.45

Tested by

no test coverage detected