working version

This commit is contained in:
2023-10-03 20:40:16 -07:00
parent 29228bd192
commit f2ad1bed9e
12 changed files with 19 additions and 1289 deletions

View File

@@ -92,6 +92,8 @@ func init() {
logger.Log.Info().Msgf(result)
}
logger.RotateLogs()
logger.ArmaOnly.Info().Msgf(`%s v%s started`, EXTENSION_NAME, "0.0.0")
logger.ArmaOnly.Info().Msgf(`Log path: %s`, logger.ActiveOptions.Path)
@@ -107,6 +109,14 @@ func init() {
logger.Log.Error().Err(err).Msgf(`Error connecting to database`)
return
}
logger.Log.Info().
Str("dialect", db.Client().Dialector.Name()).
Str("database", db.Client().Migrator().CurrentDatabase()).
Str("host", util.ConfigJSON.GetString("sqlConfig.mysqlHost")).
Int("port", util.ConfigJSON.GetInt("sqlConfig.mysqlPort")).
Msgf(`Connected to database`)
err = db.Client().Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(
&World{},
&Mission{},
@@ -119,7 +129,6 @@ func init() {
startA3CallHandlers()
initSuccess = true
logger.RotateLogs()
a3interface.WriteArmaCallback(
EXTENSION_NAME,
":READY:",

View File

@@ -22,7 +22,6 @@ require (
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/peterstace/simplefeatures v0.44.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,6 @@ package db
import (
"fmt"
"github.com/indig0fox/a3go/a3interface"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
@@ -55,8 +54,5 @@ func Connect() error {
return err
}
a3interface.WriteArmaCallback("connectDB", `["Database connected", "INFO"]`)
a3interface.WriteArmaCallback("connectDB", `["SUCCESS", "INFO"]`)
return nil
}

View File

@@ -26,9 +26,9 @@ func LoadConfig(modulePathDir string) (string, error) {
"mysqlDatabase": "a3attendance",
})
ConfigJSON.SetDefault("armaConfig", map[string]interface{}{
"debug": true,
"traceLogToFile": false,
"dbUpdateIntervalS": 60,
"debug": true,
"traceLogToFile": false,
"dbUpdateInterval": "90s",
})
wd, err := os.Getwd()