What is the "exptime" unit in "lcb_store_cmd_t"? Seconds, Milliseconds or others?

StackOverflow https://stackoverflow.com/questions/22369557

  •  13-06-2023
  •  | 
  •  

Pregunta

I want to confirm the "exptime" unit in "lcb_store_cmd_t".

I can NOT get the definite unit information from lcb_store api html(here: http://www.couchbase.com/autodocs/couchbase-c-client-2.1.3/lcb_store.3couchbase.html).

Although I have read the expiration explanation in the devguide (here: http://docs.couchbase.com/couchbase-devguide-2.1/#about-document-expiration), I can NOT confirm that the exptime unit is seconds.

I want to set the expiry time as two days (172800seconds), so I assign the exptime param with 172800, then call lcb_store. Is this OK?

¿Fue útil?

Solución

It is seconds. Personally I think the dev guide is quite explicit on the issue, but perhaps part of the ambiguity is that values greater than 30 x 24 x 60 x 60 are treated as absolute unix timestamps, and values less seconds relative from current time.

The Python SDK reference explicitly mentions the unit is seconds.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top