mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-16 13:00:40 +08:00
Added multi-database support to snapshot module
This commit is contained in:
@@ -25,7 +25,7 @@ func createEchoVaultWithConfig(conf config.Config) *EchoVault {
|
||||
}
|
||||
|
||||
func presetValue(server *EchoVault, ctx context.Context, key string, value interface{}) error {
|
||||
ctx = context.WithValue(ctx, "Database", "0")
|
||||
ctx = context.WithValue(ctx, "Database", 0)
|
||||
if err := server.setValues(ctx, map[string]interface{}{key: value}); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -33,7 +33,7 @@ func presetValue(server *EchoVault, ctx context.Context, key string, value inter
|
||||
}
|
||||
|
||||
func presetKeyData(server *EchoVault, ctx context.Context, key string, data internal.KeyData) {
|
||||
ctx = context.WithValue(ctx, "Database", "0")
|
||||
ctx = context.WithValue(ctx, "Database", 0)
|
||||
_ = server.setValues(ctx, map[string]interface{}{key: data.Value})
|
||||
server.setExpiry(ctx, key, data.ExpireAt, false)
|
||||
}
|
||||
|
Reference in New Issue
Block a user