Skip to content

fix the disorder not ignored error#51

Open
wuYin wants to merge 1 commit into
beanstalkd:masterfrom
wuYin:fix-not-ignore
Open

fix the disorder not ignored error#51
wuYin wants to merge 1 commit into
beanstalkd:masterfrom
wuYin:fix-not-ignore

Conversation

@wuYin
Copy link
Copy Markdown
Contributor

@wuYin wuYin commented Mar 2, 2021

Issue

func main() {
	c, err := beanstalk.Dial("tcp", "127.0.0.1:11300")
	if err != nil {
		log.Fatal(err)
	}

	c.TubeSet = *beanstalk.NewTubeSet(c) // ignore "default" tube
	if _, _, err = c.Reserve(1 * time.Second); err != nil {
		fmt.Println(err) // reserve-with-timeout: not ignored // ok
	}

	if _, err = c.Tube.Stats(); err != nil {
		fmt.Println(err) // stats-tube: timeout // unexpected disordered "timeout" 
	}
}

Cause

In current implementation, there is no function ignore for tubeSet or watch for tube, only adjust watching tube list before sending reserve cmd, so we sent ignore but never read NOT_IGNORED

Modification

  • Simulated return not ignored error if user ignore all tubes.
  • Discard NOT_IGNORED error text line when reading response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant