MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / PEXPIREBYAT

Method PEXPIREBYAT

structure/expiring_key.go:124–132  ·  view source on GitHub ↗
(key string, timestamp int64, tag ...string)

Source from the content-addressed store, hash-verified

122}
123
124func (ek *ExpireStructure) PEXPIREBYAT(key string, timestamp int64, tag ...string) error {
125 if len(tag) == 0 {
126 return ek.setExpireToDB(key, timestamp)
127 } else if len(tag) == 1 && tag[0] == "ex" {
128 return ek.setExpireToDB(key, ek.getCurrentMiliUnixTimeStamp()+timestamp)
129 } else {
130 return ErrInvalidArgs
131 }
132}
133
134func (ek *ExpireStructure) getCurrentMiliUnixTimeStamp() int64 {
135 now := time.Now()

Callers 1

Calls 2

setExpireToDBMethod · 0.95

Tested by 1