(m uhaha.Machine, args []string)
| 317 | } |
| 318 | return redcon.SimpleInt(v), nil |
| 319 | } |
| 320 | |
| 321 | func cmdHEXPIREAT(m uhaha.Machine, args []string) (interface{}, error) { |
| 322 | if len(args) != 3 { |
| 323 | return nil, uhaha.ErrWrongNumArgs |
| 324 | } |
| 325 | |
| 326 | timestamp, err := ledis.StrInt64([]byte(args[2]), nil) |
| 327 | if err != nil { |
| 328 | return nil, err |
| 329 | } |
| 330 | |
| 331 | //If the timestamp is less than the current time, delete operation |
| 332 | if timestamp < time.Now().Unix() { |
| 333 | _, err := ldb.HClear([]byte(args[1])) |
| 334 | if err != nil { |
| 335 | return nil, err |
| 336 | } |
| 337 | return redcon.SimpleInt(0), nil |
| 338 | } |
| 339 | |
| 340 | v, err := ldb.HExpireAt([]byte(args[1]), timestamp) |
| 341 | if err != nil { |
| 342 | return nil, err |
| 343 | } |
| 344 | return redcon.SimpleInt(v), nil |
| 345 | } |
| 346 |
nothing calls this directly
no outgoing calls
no test coverage detected