lotus-provider: additional fixes to make recover work
This commit is contained in:
parent
4b1445e3b2
commit
93fd408267
@ -146,6 +146,11 @@ func New(
|
||||
TaskTypeDetails: c.TypeDetails(),
|
||||
TaskEngine: e,
|
||||
}
|
||||
|
||||
if len(h.Name) > 16 {
|
||||
return nil, fmt.Errorf("task name too long: %s, max 16 characters", h.Name)
|
||||
}
|
||||
|
||||
e.handlers = append(e.handlers, &h)
|
||||
e.taskMap[h.TaskTypeDetails.Name] = &h
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS
|
||||
|
||||
for {
|
||||
var err error
|
||||
var sigCidStr, sendError string
|
||||
var sigCidStr, sendError *string
|
||||
var sendSuccess *bool
|
||||
|
||||
err = s.db.QueryRow(ctx, `select signed_cid, send_success, send_error from message_sends where send_task_id = $1`, &sendTaskID).Scan(&sigCidStr, &sendSuccess, &sendError)
|
||||
@ -373,6 +373,11 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS
|
||||
continue
|
||||
}
|
||||
|
||||
if sigCidStr == nil || sendError == nil {
|
||||
// should never happen because sendSuccess is already not null here
|
||||
return cid.Undef, xerrors.Errorf("got null values for sigCidStr or sendError, this should never happen")
|
||||
}
|
||||
|
||||
if !*sendSuccess {
|
||||
sendErr = xerrors.Errorf("send error: %s", sendError)
|
||||
} else {
|
||||
|
@ -217,7 +217,7 @@ func (w *WdPostRecoverDeclareTask) CanAccept(ids []harmonytask.TaskID, engine *h
|
||||
func (w *WdPostRecoverDeclareTask) TypeDetails() harmonytask.TaskTypeDetails {
|
||||
return harmonytask.TaskTypeDetails{
|
||||
Max: 128,
|
||||
Name: "WdPostRecoverDeclare",
|
||||
Name: "WdPostRecover",
|
||||
Cost: resources.Resources{
|
||||
Cpu: 1,
|
||||
Gpu: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user