(gid int)
| 265 | } |
| 266 | |
| 267 | func (ctx *context) isGroupLocked(gid int) bool { |
| 268 | if g := ctx.group[gid]; g != nil { |
| 269 | switch g.Promoting.State { |
| 270 | case models.ActionNothing: |
| 271 | return false |
| 272 | case models.ActionPreparing: |
| 273 | return false |
| 274 | case models.ActionPrepared: |
| 275 | return true |
| 276 | case models.ActionFinished: |
| 277 | return false |
| 278 | default: |
| 279 | log.Panicf("invalid state of group-[%d] = %s", g.Id, g.Encode()) |
| 280 | } |
| 281 | } |
| 282 | return false |
| 283 | } |
| 284 | |
| 285 | func (ctx *context) isGroupPromoting(gid int) bool { |
| 286 | if g := ctx.group[gid]; g != nil { |
no test coverage detected