MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdSEXPIREAT

Function cmdSEXPIREAT

set.go:181–200  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

179 return nil, err
180 }
181 return redcon.SimpleInt(0), nil
182 }
183
184 v, err := ldb.SExpireAt([]byte(args[1]), timestamp)
185 return redcon.SimpleInt(v), err
186}
187
188func cmdSEXPIREAT(m uhaha.Machine, args []string) (interface{}, error) {
189 if len(args) != 3 {
190 return nil, uhaha.ErrWrongNumArgs
191 }
192
193 timestamp, err := ledis.StrInt64([]byte(args[2]), nil)
194 if err != nil {
195 return nil, uhaha.ErrInvalid
196 }
197 if timestamp < time.Now().Unix() {
198 _, err := ldb.SClear([]byte(args[1]))
199 if err != nil {
200 return nil, err
201 }
202 return redcon.SimpleInt(0), nil
203 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected