Replace some "panic"

This commit is contained in:
Александр Федорюк 2022-11-22 09:19:07 +03:00
parent 1dc19f9e72
commit 9850bc32ce

View File

@ -51,7 +51,9 @@ func (fDesc *funcDesc) worker() {
if err != nil {
panic(err)
}
fDesc.conn.Publish(pkg.Metadata.QueueCallback, buff)
if err = fDesc.conn.Publish(pkg.Metadata.QueueCallback, buff); err != nil {
continue
}
}
continue
}
@ -80,9 +82,12 @@ func (fDesc *funcDesc) worker() {
pkg.Metadata.CallResponseID = uuid.NewV4().String()
buff, err := proto.Marshal(&pkg)
if err != nil {
panic(err)
//panic(err)
continue
}
if err = fDesc.conn.Publish(pkg.Metadata.QueueCallback, buff); err != nil {
continue
}
fDesc.conn.Publish(pkg.Metadata.QueueCallback, buff)
}
continue
case <-time.After(fDesc.timeout):
@ -248,7 +253,8 @@ func (serve *Serve) worker() {
var payload network.Function
err = proto.Unmarshal(msg.Data, &payload)
if err != nil {
panic(err)
//panic(err)
continue
}
if f, ok := serve.callbackFuncs[payload.Metadata.CallID]; ok {
serve.callbackFuncsMutex.Lock()