Skip to content

Commit c12c48d

Browse files
committed
🐛 fix setdata&getdata
1 parent 7dd8152 commit c12c48d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

control/rule.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (m *Control) GetData(gid int64) int64 {
215215
err = db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(gid, 10))
216216
m.RUnlock()
217217
if err == nil && gid == c.GroupID {
218-
log.Debugf("[control] plugin %s of grp %d : %x", m.service, c.GroupID, c.Disable>>1)
218+
log.Debugf("[control] plugin %s of grp %d : 0x%x", m.service, c.GroupID, c.Disable>>1)
219219
return c.Disable >> 1
220220
}
221221
return 0
@@ -233,8 +233,9 @@ func (m *Control) SetData(groupID int64, data int64) error {
233233
c.Disable = 1
234234
}
235235
}
236+
c.Disable &= 1
236237
c.Disable |= data << 1
237-
log.Debugf("[control] set plugin %s of all : %x", m.service, data)
238+
log.Debugf("[control] set plugin %s of grp %d : 0x%x", m.service, c.GroupID, data)
238239
m.Lock()
239240
err = db.Insert(m.service, &c)
240241
m.Unlock()

0 commit comments

Comments
 (0)