move model retrain to runners closes #94

This commit is contained in:
2024-04-16 17:48:52 +01:00
parent f182b205f8
commit 06642dcb1e
9 changed files with 165 additions and 96 deletions

View File

@@ -21,6 +21,10 @@ type ServiceUser struct {
UserId string `toml:"__user__id__"`
}
type DbInfo struct {
MaxConnections int `toml:"max_connections"`
}
type Config struct {
Hostname string
Port int
@@ -30,6 +34,8 @@ type Config struct {
GpuWorker WorkerConfig `toml:"Worker"`
ServiceUser ServiceUser `toml:"ServiceUser"`
DbInfo DbInfo `toml:"DB"`
}
func LoadConfig() Config {
@@ -52,6 +58,9 @@ func LoadConfig() Config {
User: "Service",
UserId: "",
},
DbInfo: DbInfo{
MaxConnections: 200,
},
}
}
@@ -84,13 +93,13 @@ func (c *Config) GenerateToken(db *sql.DB) {
Email string
Salt string
Password string
UserType UserType `db:"user_type"`
UserType UserType `db:"user_type"`
}{
c.ServiceUser.User,
c.ServiceUser.User,
"",
"",
User_Admin,
User_Admin,
}
id, err := InsertReturnId(db, &newUser, "users", "id")
if err != nil {