drop sqlite

This commit is contained in:
JurajKubrican
2025-08-04 15:22:34 +02:00
parent 73b2e445b4
commit a393b03d98
6 changed files with 26 additions and 192 deletions

View File

@@ -2,11 +2,9 @@ package boxes
import (
"fmt"
"math/rand"
"strconv"
"strings"
"sync"
"time"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
@@ -16,8 +14,6 @@ import (
var (
wsConnections = make(map[*websocket.Conn]bool)
wsMutex sync.Mutex
db = initDb()
random = rand.New(rand.NewSource(time.Now().UnixNano()))
)
type Box struct {
@@ -69,10 +65,7 @@ func randomizeBoxes(count int) []Box {
boxes := make([]Box, count)
for i := 0; i < count; i++ {
index := random.Int() % 1000
box, err := getBox(index)
if err != nil {
log.Fatal(err)
}
box := getBox(index)
box.Value = !box.Value
box.persist()
boxes[i] = box