mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-23 18:27:57 +02:00
Update dependencies (#197)
Go 1.20 -> 1.21 JS package-lock Nodejs Docker 18 -> 20 Alpine Docker 3.17 -> 3.19
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -137,7 +138,7 @@ func InitLog() {
|
||||
)
|
||||
for _, logOutputType := range logOutputTypes {
|
||||
logOutputType = strings.TrimSpace(logOutputType)
|
||||
if !utils.SliceContains([]string{"stdout", "file"}, logOutputType) {
|
||||
if !slices.Contains([]string{"stdout", "file"}, logOutputType) {
|
||||
defer func() { log.Warn().Msg("Invalid log output type: " + logOutputType) }()
|
||||
continue
|
||||
}
|
||||
@ -163,7 +164,7 @@ func InitLog() {
|
||||
multi := zerolog.MultiLevelWriter(logWriters...)
|
||||
log.Logger = zerolog.New(multi).Level(level).With().Timestamp().Logger()
|
||||
|
||||
if !utils.SliceContains([]string{"trace", "debug", "info", "warn", "error", "fatal", "panic"}, strings.ToLower(C.LogLevel)) {
|
||||
if !slices.Contains([]string{"trace", "debug", "info", "warn", "error", "fatal", "panic"}, strings.ToLower(C.LogLevel)) {
|
||||
log.Warn().Msg("Invalid log level: " + C.LogLevel)
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package db
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
msqlite "github.com/glebarez/go-sqlite"
|
||||
"github.com/glebarez/sqlite"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/thomiceli/opengist/internal/config"
|
||||
"github.com/thomiceli/opengist/internal/utils"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
@ -19,7 +19,7 @@ func Setup(dbPath string, sharedCache bool) error {
|
||||
var err error
|
||||
journalMode := strings.ToUpper(config.C.SqliteJournalMode)
|
||||
|
||||
if !utils.SliceContains([]string{"DELETE", "TRUNCATE", "PERSIST", "MEMORY", "WAL", "OFF"}, journalMode) {
|
||||
if !slices.Contains([]string{"DELETE", "TRUNCATE", "PERSIST", "MEMORY", "WAL", "OFF"}, journalMode) {
|
||||
log.Warn().Msg("Invalid SQLite journal mode: " + journalMode)
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,5 @@
|
||||
package utils
|
||||
|
||||
func SliceContains(slice []string, item string) bool {
|
||||
for _, s := range slice {
|
||||
if s == item {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func RemoveDuplicates[T string | int](sliceList []T) []T {
|
||||
allKeys := make(map[T]bool)
|
||||
list := []T{}
|
||||
|
Reference in New Issue
Block a user