mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 11:27:50 +00:00
Merge pull request #2105 from zhanglistar/master
1. modify unprotectedGenerateResizeJob to return early iif resizing job
This commit is contained in:
commit
72d5081a44
1 changed files with 3 additions and 3 deletions
|
|
@ -1195,6 +1195,9 @@ func (c *cluster) listenForJoins() {
|
|||
// for future lookup by JobID.
|
||||
func (c *cluster) unprotectedGenerateResizeJob(nodeAction nodeAction) (*resizeJob, error) {
|
||||
c.logger.Printf("generateResizeJob: %v", nodeAction)
|
||||
if c.currentJob != nil {
|
||||
return nil, fmt.Errorf("there is currently a resize job running")
|
||||
}
|
||||
|
||||
j, err := c.unprotectedGenerateResizeJobByAction(nodeAction)
|
||||
if err != nil {
|
||||
|
|
@ -1206,9 +1209,6 @@ func (c *cluster) unprotectedGenerateResizeJob(nodeAction nodeAction) (*resizeJo
|
|||
c.jobs[j.ID] = j
|
||||
|
||||
// Set job as currentJob.
|
||||
if c.currentJob != nil {
|
||||
return nil, fmt.Errorf("there is currently a resize job running")
|
||||
}
|
||||
c.currentJob = j
|
||||
|
||||
return j, nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue