lpmessage: Fix watcher

This commit is contained in:
Łukasz Magiera 2024-01-05 17:07:55 +01:00
parent dd6a0095b0
commit 902a0fc524
2 changed files with 5 additions and 5 deletions

View File

@ -66,13 +66,13 @@ func (s *ProviderChainSched) Run(ctx context.Context) {
} }
gotCur = false gotCur = false
log.Info("restarting window post scheduler") log.Info("restarting chain scheduler")
} }
select { select {
case changes, ok := <-notifs: case changes, ok := <-notifs:
if !ok { if !ok {
log.Warn("window post scheduler notifs channel closed") log.Warn("chain notifs channel closed")
notifs = nil notifs = nil
continue continue
} }
@ -124,7 +124,7 @@ func (s *ProviderChainSched) Run(ctx context.Context) {
func (s *ProviderChainSched) update(ctx context.Context, revert, apply *types.TipSet) { func (s *ProviderChainSched) update(ctx context.Context, revert, apply *types.TipSet) {
if apply == nil { if apply == nil {
log.Error("no new tipset in window post ProviderChainSched.update") log.Error("no new tipset in ProviderChainSched.update")
return return
} }

View File

@ -44,7 +44,7 @@ func NewMessageWatcher(db *harmonydb.DB, ht *harmonytask.TaskEngine, pcs *chains
stopped: make(chan struct{}), stopped: make(chan struct{}),
updateCh: make(chan struct{}), updateCh: make(chan struct{}),
} }
mw.run() go mw.run()
if err := pcs.AddHandler(mw.processHeadChange); err != nil { if err := pcs.AddHandler(mw.processHeadChange); err != nil {
return nil, err return nil, err
} }
@ -107,7 +107,7 @@ func (mw *MessageWatcher) update() {
} }
// really large limit in case of things getting stuck and backlogging severely // really large limit in case of things getting stuck and backlogging severely
err = mw.db.Select(ctx, &msgs, `SELECT signed_message_cid, from_key, nonce FROM message_wait err = mw.db.Select(ctx, &msgs, `SELECT signed_message_cid, from_key, nonce FROM message_waits
JOIN message_sends ON signed_message_cid = signed_cid JOIN message_sends ON signed_message_cid = signed_cid
WHERE waiter_machine_id = $1 LIMIT 10000`, machineID) WHERE waiter_machine_id = $1 LIMIT 10000`, machineID)
if err != nil { if err != nil {