Skip to content

Commit

Permalink
default to sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
dtornow committed Sep 14, 2023
1 parent 4726db3 commit db47def
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/resonatehq/resonate/internal/api"
"github.com/resonatehq/resonate/internal/app/coroutines"
"github.com/resonatehq/resonate/internal/app/subsystems/aio/network"
"github.com/resonatehq/resonate/internal/app/subsystems/aio/store/postgres"
"github.com/resonatehq/resonate/internal/app/subsystems/aio/store/sqlite"
"github.com/resonatehq/resonate/internal/app/subsystems/api/grpc"
"github.com/resonatehq/resonate/internal/app/subsystems/api/http"
"github.com/resonatehq/resonate/internal/kernel/system"
Expand Down Expand Up @@ -57,25 +57,25 @@ var serveCmd = &cobra.Command{

// instatiate aio subsystems
network := network.New(10 * time.Second)
// store, err := sqlite.New(sqlite.Config{Path: "resonate.db"})
// if err != nil {
// return err
// }

store, err := postgres.New(postgres.Config{
Host: os.Getenv("POSTGRES_HOST"),
Port: os.Getenv("POSTGRES_PORT"),
Username: os.Getenv("POSTGRES_USER"),
Password: os.Getenv("POSTGRES_PASSWORD"),
Database: os.Getenv("POSTGRES_DB"),
MaxOpenConns: 3,
MaxIdleConns: 3,
ConnMaxIdleTime: 0,
})
store, err := sqlite.New(sqlite.Config{Path: "resonate.db"})
if err != nil {
return err
}

// store, err := postgres.New(postgres.Config{
// Host: os.Getenv("POSTGRES_HOST"),
// Port: os.Getenv("POSTGRES_PORT"),
// Username: os.Getenv("POSTGRES_USER"),
// Password: os.Getenv("POSTGRES_PASSWORD"),
// Database: os.Getenv("POSTGRES_DB"),
// MaxOpenConns: 3,
// MaxIdleConns: 3,
// ConnMaxIdleTime: 0,
// })
// if err != nil {
// return err
// }

// add subsystems
api.AddSubsystem(http)
api.AddSubsystem(grpc)
Expand Down

0 comments on commit db47def

Please sign in to comment.