(m uhaha.Machine, args []string)
| 156 | if len(args) < 2 { |
| 157 | return nil, uhaha.ErrWrongNumArgs |
| 158 | } |
| 159 | |
| 160 | n, err := ldb.SMclear(stringSliceToBytes(args[1:])...) |
| 161 | |
| 162 | return redcon.SimpleInt(n), err |
| 163 | } |
| 164 | |
| 165 | func cmdSEXPIRE(m uhaha.Machine, args []string) (interface{}, error) { |
| 166 | if len(args) != 3 { |
| 167 | return nil, uhaha.ErrWrongNumArgs |
| 168 | } |
| 169 | |
| 170 | duration, err := ledis.StrInt64([]byte(args[2]), nil) |
| 171 | if err != nil { |
| 172 | return nil, uhaha.ErrInvalid |
| 173 | } |
| 174 | |
| 175 | timestamp := m.Now().Unix() + duration |
| 176 | if timestamp < time.Now().Unix() { |
| 177 | _, err := ldb.SClear([]byte(args[1])) |
| 178 | if err != nil { |
| 179 | return nil, err |
| 180 | } |
| 181 | return redcon.SimpleInt(0), nil |
| 182 | } |
nothing calls this directly
no outgoing calls
no test coverage detected