make models only train one at the time closes #48
This commit is contained in:
@@ -199,6 +199,10 @@ func (c Context) GetLogger() *log.Logger {
|
||||
return c.Logger
|
||||
}
|
||||
|
||||
func (c Context) GetHost() string {
|
||||
return c.Handle.Config.Hostname
|
||||
}
|
||||
|
||||
func (c Context) Query(query string, args ...any) (*sql.Rows, error) {
|
||||
return c.Db.Query(query, args...)
|
||||
}
|
||||
@@ -337,11 +341,11 @@ func (c *Context) GetModelFromId(id_path string) (*dbtypes.BaseModel, *Error) {
|
||||
return model, nil
|
||||
}
|
||||
|
||||
func ModelUpdateStatus(c *Context, id string, status int) {
|
||||
_, err := c.Db.Exec("update models set status=$1 where id=$2;", status, id)
|
||||
func ModelUpdateStatus(c dbtypes.BasePack, id string, status int) {
|
||||
_, err := c.GetDb().Exec("update models set status=$1 where id=$2;", status, id)
|
||||
if err != nil {
|
||||
c.Logger.Error("Failed to update model status", "err", err)
|
||||
c.Logger.Warn("TODO Maybe handle better")
|
||||
c.GetLogger().Error("Failed to update model status", "err", err)
|
||||
c.GetLogger().Warn("TODO Maybe handle better")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user