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

Function cmdSET

strings.go:662–672  ·  view source on GitHub ↗

This is different from the RESP standard. It needs to enrich the algorithm to support more atomic instructions.

(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

660}
661
662// expireSecondsFromMillis converts a millisecond TTL into the whole seconds the
663// storage layer keeps, rounding up so a key never expires earlier than asked for.
664func expireSecondsFromMillis(ms int64) int64 {
665 if ms <= 0 {
666 return 0
667 }
668 sec := ms / 1000
669 if ms%1000 != 0 {
670 sec++
671 }
672 return sec
673}
674
675// cmdSET implements the Redis SET command.

Callers

nothing calls this directly

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected