Skip to content

Commit

Permalink
fix(admin): add writer flag to help admin init (arana-db#507)
Browse files Browse the repository at this point in the history
Co-authored-by: Jianhui Dong <[email protected]>
  • Loading branch information
Mulavar and Jianhui Dong authored Nov 13, 2022
1 parent b5e3e36 commit f676667
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions pkg/boot/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func (fp *discovery) InitTenant(tenant string) error {
config.WithCacheable(true),
config.WithReader(true),
config.WithWatcher(true),
config.WithWriter(true),
)
return err
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/sequence/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func init() {
const (
SequencePluginName = "group"

_stepKey = "step"
_startSequence int64 = 1
_defaultGroupStrep int64 = 100
_stepKey = "step"
_startSequence int64 = 1
_defaultGroupStep int64 = 100

_initGroupSequenceTableSql = `
CREATE TABLE IF NOT EXISTS __arana_group_sequence (
Expand Down Expand Up @@ -94,7 +94,7 @@ func (seq *groupSequence) Start(ctx context.Context, option proto.SequenceConfig
}

// init sequence
if err := seq.initStep(ctx, rt, option); err != nil {
if err := seq.initStep(option); err != nil {
return err
}

Expand Down Expand Up @@ -131,7 +131,7 @@ func (seq *groupSequence) initTable(ctx context.Context, rt runtime.Runtime) err
return nil
}

func (seq *groupSequence) initStep(ctx context.Context, rt runtime.Runtime, option proto.SequenceConfig) error {
func (seq *groupSequence) initStep(option proto.SequenceConfig) error {
seq.mu.Lock()
defer seq.mu.Unlock()

Expand All @@ -144,7 +144,7 @@ func (seq *groupSequence) initStep(ctx context.Context, rt runtime.Runtime, opti
}
step = int64(tempStep)
} else {
step = _defaultGroupStrep
step = _defaultGroupStep
}
seq.step = step

Expand Down

0 comments on commit f676667

Please sign in to comment.