Skip to content

Commit 5eb29cf

Browse files
authored
fix(badger): handle boolean values (#627)
1 parent b1477d5 commit 5eb29cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/caddy/configuration.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ func parseBadgerConfiguration(c map[string]interface{}) map[string]interface{} {
278278
c[k] = v
279279
case "SyncWrites", "ReadOnly", "InMemory", "MetricsEnabled", "CompactL0OnClose", "LmaxCompaction", "VerifyValueChecksum", "BypassLockGuard", "DetectConflicts":
280280
c[k] = true
281+
if v != nil {
282+
val, ok := v.(string)
283+
if ok {
284+
c[k], _ = strconv.ParseBool(val)
285+
}
286+
}
281287
case "NumVersionsToKeep", "NumGoroutines", "MemTableSize", "BaseTableSize", "BaseLevelSize", "LevelSizeMultiplier", "TableSizeMultiplier", "MaxLevels", "ValueThreshold", "NumMemtables", "BlockSize", "BlockCacheSize", "IndexCacheSize", "NumLevelZeroTables", "NumLevelZeroTablesStall", "ValueLogFileSize", "NumCompactors", "ZSTDCompressionLevel", "ChecksumVerificationMode", "NamespaceOffset":
282288
c[k], _ = strconv.Atoi(v.(string))
283289
case "Compression", "ValueLogMaxEntries":

0 commit comments

Comments
 (0)