Skip to content

Commit 3a7563c

Browse files
committed
api: rest: Wait for 10 seconds in sleep time task if time value is not provided
1 parent 14ef38b commit 3a7563c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/api/rest/controller/cicadaTaskComponent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func RunScript(c echo.Context) error {
6464
//
6565
// @ID sleep-time
6666
// @Summary Run sleep command on cicada
67-
// @Description Runs sleep command on cicada and waits for configured time.
67+
// @Description Runs sleep command on cicada and waits for configured time. Wait for 10 seconds if time value is not provided.
6868
// @Tags [Cicada Task Component]
6969
// @Accept json
7070
// @Produce json
@@ -81,7 +81,7 @@ func SleepTime(c echo.Context) error {
8181
}
8282

8383
if sleepTimeReq.Time == "" {
84-
return common.ReturnErrorMsg(c, "Please provide the time.")
84+
sleepTimeReq.Time = "10s"
8585
}
8686

8787
var result model.SimpleMsg

0 commit comments

Comments
 (0)