keyv.ttl
0.000005

Gets the ttl of a key.

Arguments
bucketrequired
The bucket the key is stored under.
key
The key to get the ttl for.
Return Value
The ttl for the key in seconds with microsecond precision, or null if the key is not set to expire or does not exist.
something went wrong :(
Getting the ttl of a key
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.keyv.set.call(
  bucket: "obae9b2f", value: "foo", ttl: 60
)

client.keyv.ttl.call(
  bucket: "obae9b2f"
)
client.keyv.set.call(
  undefined, obae9b2f
);

client.keyv.ttl.call(
  undefined, obae9b2f
);
curl "https://proc.run/keyv/set?bucket=obae9b2f&ttl=60" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo"

curl "https://proc.run/keyv/ttl?bucket=obae9b2f" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
 

59.404855


Stuck? Want to chat about an idea? Join the community on Discord.