(ctx context.Context, params *riverdriver.JobRetryParams)
| 695 | } |
| 696 | |
| 697 | func (e *Executor) JobRetry(ctx context.Context, params *riverdriver.JobRetryParams) (*rivertype.JobRow, error) { |
| 698 | // Unlike Postgres, this must be carried out in two operations because |
| 699 | // SQLite doesn't support CTEs containing `UPDATE`. As long as the job |
| 700 | // exists and is not running, only one database operation is needed, but if |
| 701 | // the initial update comes back empty, it does one more fetch to return the |
| 702 | // most appropriate error. |
| 703 | return dbutil.WithTxV(ctx, e, func(ctx context.Context, execTx riverdriver.ExecutorTx) (*rivertype.JobRow, error) { |
| 704 | dbtx := templateReplaceWrapper{dbtx: e.driver.UnwrapTx(execTx), replacer: &e.driver.replacer} |
| 705 | |
| 706 | job, err := dbsqlc.New().JobRetry(schemaTemplateParam(ctx, params.Schema), dbtx, &dbsqlc.JobRetryParams{ |
| 707 | ID: params.ID, |
| 708 | Now: timeStringNullable(params.Now), |
| 709 | }) |
| 710 | if err != nil { |
| 711 | if errors.Is(err, sql.ErrNoRows) { |
| 712 | job, err := execTx.JobGetByID(ctx, &riverdriver.JobGetByIDParams{ |
| 713 | ID: params.ID, |
| 714 | Schema: params.Schema, |
| 715 | }) |
| 716 | if err != nil { |
| 717 | return nil, interpretError(err) |
| 718 | } |
| 719 | return job, nil |
| 720 | } |
| 721 | |
| 722 | return nil, interpretError(err) |
| 723 | } |
| 724 | return jobRowFromInternal(job) |
| 725 | }) |
| 726 | } |
| 727 | |
| 728 | func (e *Executor) JobSchedule(ctx context.Context, params *riverdriver.JobScheduleParams) ([]*riverdriver.JobScheduleResult, error) { |
| 729 | // This operation diverges the most from the Postgres version out of all the |
nothing calls this directly
no test coverage detected