store: remove write TTL & expiry options (#1960)

This commit is contained in:
ben-toogood
2020-08-21 09:35:53 +01:00
committed by GitHub
parent f146b52418
commit 1ae825032c
5 changed files with 14 additions and 91 deletions

View File

@@ -433,15 +433,9 @@ func (s *sqlStore) Write(r *store.Record, opts ...store.WriteOption) error {
}
var expiry time.Time
// expiry from options takes precedence
if !options.Expiry.IsZero() {
expiry = options.Expiry
} else if r.Expiry != 0 {
if r.Expiry != 0 {
expiry = time.Now().Add(r.Expiry)
}
if options.TTL != 0 {
expiry = time.Now().Add(options.TTL)
}
if expiry.IsZero() {
_, err = st.Exec(r.Key, r.Value, metadata, nil)