File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -142,17 +142,18 @@ func NewScorch(storeName string,
142142// configForceSegmentTypeVersion checks if the caller has requested a
143143// specific segment type/version
144144func configForceSegmentTypeVersion (config map [string ]interface {}) (string , uint32 , error ) {
145- forcedSegmentVersion , ok := config ["forceSegmentVersion" ].(int )
146- if ok {
147- forcedSegmentType , ok2 := config ["forceSegmentType" ].(string )
148- if ! ok2 {
149- return "" , 0 , fmt .Errorf (
150- "forceSegmentVersion set to %d, must also specify forceSegmentType" , forcedSegmentVersion )
151- }
145+ forcedSegmentVersion , err := parseToInteger (config ["forceSegmentVersion" ])
146+ if err != nil {
147+ return "" , 0 , nil
148+ }
152149
153- return forcedSegmentType , uint32 (forcedSegmentVersion ), nil
150+ forcedSegmentType , ok := config ["forceSegmentType" ].(string )
151+ if ! ok {
152+ return "" , 0 , fmt .Errorf (
153+ "forceSegmentVersion set to %d, must also specify forceSegmentType" , forcedSegmentVersion )
154154 }
155- return "" , 0 , nil
155+
156+ return forcedSegmentType , uint32 (forcedSegmentVersion ), nil
156157}
157158
158159func (s * Scorch ) paused () uint64 {
You can’t perform that action at this time.
0 commit comments