Skip to content

Commit

Permalink
fix cron based test scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Feb 20, 2024
1 parent 6307051 commit 22c6021
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pkg/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ func (c *Coordinator) runTestScheduler(ctx context.Context) {
break
}

if cronExpr.Next(cronTime).IsZero() {
next := cronExpr.Next(cronTime.Add(-1 * time.Second))
if next.Compare(cronTime) == 0 {
triggerTest = true
break
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/coordinator/web/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ func (ws *WebServer) getSwaggerHandler(logger logrus.FieldLogger) http.HandlerFu
headerScript.WriteString("var headerHtml = ")
headerScript.Write(headerStr)
headerScript.WriteString(";")
headerScript.WriteString("var headerEl = document.createElement(\"div\");")
headerScript.WriteString("headerEl.className = \"header\";")
headerScript.WriteString("headerEl.innerHTML = headerHtml;")
headerScript.WriteString("document.body.insertBefore(headerEl, document.body.firstElementChild);")
headerScript.WriteString("var headerEl = document.createElement(\"div\"); headerEl.className = \"header\"; headerEl.innerHTML = headerHtml; document.body.insertBefore(headerEl, document.body.firstElementChild);")
headerScript.WriteString(`function addCss(fileName) { var el = document.createElement("link"); el.type = "text/css"; el.rel = "stylesheet"; el.href = fileName; document.head.appendChild(el); }`)
headerScript.WriteString(`function addStyle(cssCode) { var el = document.createElement("style"); el.type = "text/css"; el.appendChild(document.createTextNode(cssCode)); document.head.appendChild(el); }`)
headerScript.WriteString(`addCss("/css/bootstrap.min.css");`)
Expand Down

0 comments on commit 22c6021

Please sign in to comment.