You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Descriptiion: When starting a new charm app with sample code I get gateway timeouts when writing a new key.
Reproduction:
Reproduced with a fresh run after removing any databases in my .local directory after the run I noticed the new db in place.
package main
import (
"fmt"
"log"
"github.com/charmbracelet/charm/kv"
)
func main() {
// Open a database (or create one if it doesn’t exist)
db, err := kv.OpenWithDefaults("data.kv")
if err != nil {
log.Fatal(err)
}
defer db.Close()
// Fetch updates and easily define your own syncing strategy
if err := db.Sync(); err != nil {
log.Fatal(err)
}
// Save some data
if err := db.Set([]byte("alpha"), []byte("{\"online\":true}")); err != nil {
log.Fatal(err)
}
// Quickly set a value
err = db.Set([]byte("bravo"), []byte("two")) //<================ GATEWAY TIMEOUT HAPPENS HERE
if err != nil {
panic(err)
}
// Quickly get a value
v, err := db.Get([]byte("alpha"))
if err != nil {
panic(err)
}
fmt.Printf("got value: %s\n", string(v))
// Fetching all the keys so I can iterate and print them below.
keys, err := db.Keys()
if err != nil {
panic(err)
}
for _, v := range keys {
fmt.Println("KEY: ", string(v))
}
}
Output:
go run main.go
panic: server error: 504 Gateway Timeout
goroutine 1 [running]:
main.main()
/home/silenterror/go/src/gitlab.com/silenterror/charmkv/main.go:32 +0x3c5
exit status 2
I was working until I tried the delete method. Deleted the database tried again and it worked and then started to hang again. Any ideas would be awesome if not I guess I'll implement badger or something light but I REALLY want to start working with the Charm libraries they look amazing.
The text was updated successfully, but these errors were encountered:
Descriptiion: When starting a new charm app with sample code I get gateway timeouts when writing a new key.
Reproduction:
Reproduced with a fresh run after removing any databases in my .local directory after the run I noticed the new db in place.
Output:
I was working until I tried the delete method. Deleted the database tried again and it worked and then started to hang again. Any ideas would be awesome if not I guess I'll implement badger or something light but I REALLY want to start working with the Charm libraries they look amazing.
The text was updated successfully, but these errors were encountered: