Skip to content

Commit 5bb0bb3

Browse files
authored
fix psd wait time column (#416)
1 parent 646c67f commit 5bb0bb3

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

tasks/storage-market/storage_market.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func (d *CurioStorageDealMarket) processMk12Deal(ctx context.Context, deal MK12P
307307
if deal.Started && !deal.AfterCommp && deal.CommTaskID == nil {
308308
// Skip commP is configured to do so
309309
if d.cfg.Market.StorageMarketConfig.MK12.SkipCommP {
310-
_, err := d.db.Exec(ctx, `UPDATE market_mk12_deal_pipeline SET after_commp = TRUE, commp_task_id = NULL WHERE uuid = $1`, deal.UUID)
310+
_, err := d.db.Exec(ctx, `UPDATE market_mk12_deal_pipeline SET after_commp = TRUE, psd_wait_time = NOW(), commp_task_id = NULL WHERE uuid = $1`, deal.UUID)
311311
if err != nil {
312312
return xerrors.Errorf("UUID: %s: updating deal pipeline: %w", deal.UUID, err)
313313
}

tasks/storage-market/task_commp.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,14 @@ func (c *CommpTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done
196196
return false, xerrors.Errorf("commP mismatch calculated %s and supplied %s", pcid, calculatedCommp.PieceCID)
197197
}
198198

199-
n, err := c.db.Exec(ctx, `UPDATE market_mk12_deal_pipeline SET after_commp = TRUE, commp_task_id = NULL WHERE commp_task_id = $1`, taskID)
199+
n, err := c.db.Exec(ctx, `UPDATE market_mk12_deal_pipeline SET after_commp = TRUE, psd_wait_time = NOW(), commp_task_id = NULL WHERE commp_task_id = $1`, taskID)
200200
if err != nil {
201201
return false, xerrors.Errorf("store commp success: updating deal pipeline: %w", err)
202202
}
203203
if n != 1 {
204204
return false, xerrors.Errorf("store commp success: updated %d rows", n)
205205
}
206206

207-
_, err = c.db.Exec(ctx, `UPDATE market_mk12_deal_pipeline SET psd_wait_time = NOW() AT TIME ZONE 'UTC' WHERE uuid = $1`, piece.UUID)
208-
if err != nil {
209-
return false, xerrors.Errorf("store psd time: updating deal pipeline: %w", err)
210-
}
211-
212207
return true, nil
213208
}
214209

0 commit comments

Comments
 (0)