Browse Source

set cassandra ttl with entry.TTLSec

pull/827/head
Chris Lu 6 years ago
parent
commit
2a75a36b27
  1. 4
      weed/filer2/cassandra/cassandra_store.go

4
weed/filer2/cassandra/cassandra_store.go

@ -48,8 +48,8 @@ func (store *CassandraStore) InsertEntry(entry *filer2.Entry) (err error) {
} }
if err := store.session.Query( if err := store.session.Query(
"INSERT INTO filemeta (directory,name,meta) VALUES(?,?,?)",
dir, name, meta).Exec(); err != nil {
"INSERT INTO filemeta (directory,name,meta) VALUES(?,?,?) USING TTL ? ",
dir, name, meta, entry.TtlSec).Exec(); err != nil {
return fmt.Errorf("insert %s: %s", entry.FullPath, err) return fmt.Errorf("insert %s: %s", entry.FullPath, err)
} }

Loading…
Cancel
Save