Skip to content

Commit

Permalink
✏️ 修复 control 全局禁用
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 26, 2021
1 parent d4bceb1 commit f8ca935
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion control/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func (m *Control) IsEnabledIn(gid int64) bool {
m.RLock()
err = db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(gid, 10))
m.RUnlock()
logrus.Debugln("[control] db find gid =", c.GroupID)
if err == nil && gid == c.GroupID {
logrus.Debugf("[control] plugin %s of grp %d : %d", m.service, c.GroupID, c.Disable)
return c.Disable == 0
Expand Down
7 changes: 2 additions & 5 deletions utils/sql/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,14 @@ func (db *Sqlite) Find(table string, objptr interface{}, condition string) error
if !rows.Next() {
return errors.New("sql.Find: null result")
}

err = rows.Scan(addrs(objptr)...)
for rows.Next() {
if err != nil {
return err
}
err = rows.Scan(addrs(objptr)...)
if err != nil {
return err
}
}
return nil
return err
}

// ListTables 列出所有表名
Expand Down

0 comments on commit f8ca935

Please sign in to comment.