Skip to content

I've encountered some issues while using it. Can you help me? #380

Open
@DarkiT

Description

@DarkiT

Hello, my friend. Thank you for providing such an excellent extension library, but I've encountered some issues while using it. Can you help me?

I have some not-so-important data to store, but I don't want to add an additional RedisServer, so I used the library you developed. It works great most of the time, but I encountered a problem when I stopped the service and tried to export the data. For example, the code s.Dump() below doesn't have any data.

func main() {
    ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
    defer stop()

    s := miniredis.NewMiniRedis()
    s.DB(16)
    if err := s.StartAddr(":6379"); err != nil {
        return
    }
    slog.Info(s.Addr())

    <-ctx.Done()
    slog.Info("export", slog.String("db", s.Dump()))
    s.Close()
    slog.Info("stop server")
}

Based on the above requirements, I hope there is an import and export to file feature so that the data stored in the last session can be automatically restored when the service stops and resumes. It would be best if the exported files could be compressed to save hard drive space. Do you have any plans to add this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions