MCPcopy Index your code
hub / github.com/riverqueue/river / insertManyFast

Method insertManyFast

client.go:2160–2176  ·  view source on GitHub ↗
(ctx context.Context, execTx riverdriver.ExecutorTx, params []InsertManyParams)

Source from the content-addressed store, hash-verified

2158}
2159
2160func (c *Client[TTx]) insertManyFast(ctx context.Context, execTx riverdriver.ExecutorTx, params []InsertManyParams) ([]*rivertype.JobInsertResult, error) {
2161 insertParams, err := c.insertManyParams(params)
2162 if err != nil {
2163 return nil, err
2164 }
2165
2166 return c.insertManyShared(ctx, execTx, insertParams, func(ctx context.Context, insertParams []*riverdriver.JobInsertFastParams) ([]*rivertype.JobInsertResult, error) {
2167 count, err := execTx.JobInsertFastManyNoReturning(ctx, &riverdriver.JobInsertFastManyParams{
2168 Jobs: insertParams,
2169 Schema: c.config.Schema,
2170 })
2171 if err != nil {
2172 return nil, err
2173 }
2174 return make([]*rivertype.JobInsertResult, count), nil
2175 })
2176}
2177
2178// Notify the given queues that new jobs are available. The queues list will be
2179// deduplicated and each will be checked to see if it is due for an insert

Callers 2

InsertManyFastMethod · 0.95
InsertManyFastTxMethod · 0.95

Calls 3

insertManyParamsMethod · 0.95
insertManySharedMethod · 0.95

Tested by

no test coverage detected