Skip to content

Commit dd05984

Browse files
author
Charlie Root
committed
always exit on error
1 parent abf55ce commit dd05984

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

beanstalk.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ func beanstalkdConsume(config BeanstalkConfig) error {
102102
id, body, err := c.Reserve(time.Duration(config.ReserveTimeout) * time.Second)
103103

104104
if err != nil {
105-
//Infof("\nid: %d, res: %s\n",id, err.Error())
105+
if ( err.Error() == "reserve-with-timeout: timeout" ) {
106+
//Infof("\nTIMEOUT: id: %d, res: [%s]\n",id, err.Error())
107+
} else {
108+
Fatalf("\nFATAL ERROR: id: %d, res: [%s]\n",id, err.Error())
109+
}
106110
}
107111

108112
if id == 0 {

0 commit comments

Comments
 (0)