Files
tasks/common/persistence/sql/task_store.go
Stephan BehnkeandGitHub 40ae7dd276 Rename Db field to DB (#8281)
## What changed?

Rename Db struct field to DB. 

## Why?

Linter forced me to on another PR; breaking this out into this one.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-09-04 13:51:42 -07:00

46 lines
1.1 KiB
Go

package sql
import (
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/persistence/sql/sqlplugin"
)
type taskQueuePageToken struct {
MinRangeHash uint32
MinTaskQueueId []byte
}
type matchingTaskPageToken struct {
TaskPass int64 `json:",omitempty"`
TaskID int64
}
type userDataListNextPageToken struct {
LastTaskQueueName string
}
// newTaskPersistence creates a new instance of TaskStore
func newTaskPersistence(
db sqlplugin.DB,
taskScanPartitions int,
logger log.Logger,
enableFairness bool,
) (persistence.TaskStore, error) {
store := SqlStore{
DB: db,
logger: logger,
}
userDataStore := userDataStore{SqlStore: store}
taskQueueStore := taskQueueStore{
SqlStore: store,
version: sqlplugin.MatchingTaskVersion1,
taskScanPartitions: uint32(taskScanPartitions),
}
if enableFairness {
taskQueueStore.version = sqlplugin.MatchingTaskVersion2
return newTaskManagerV2(db, userDataStore, taskQueueStore, logger)
}
return newTaskManagerV1(db, userDataStore, taskQueueStore, logger)
}