mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-04 17:33:21 +08:00
Show alert if more than 5 instances are created
This commit is contained in:
@@ -13,6 +13,12 @@ func NewInstance(rw http.ResponseWriter, req *http.Request) {
|
||||
sessionId := bone.GetValue(req, "sessionId")
|
||||
|
||||
s := services.GetSession(sessionId)
|
||||
|
||||
if len(s.Instances) >= 5 {
|
||||
rw.WriteHeader(http.StatusConflict)
|
||||
return
|
||||
}
|
||||
|
||||
i, err := services.NewInstance(s)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
Reference in New Issue
Block a user